mirror of
https://github.com/spacedeck/spacedeck-open.git
synced 2025-12-16 09:57:30 +01:00
use configurable default colors on reset
This commit is contained in:
44
README.md
44
README.md
@@ -48,28 +48,36 @@ See [config/default.json](config/default.json). Set `storage_local_path` for a l
|
|||||||
## Configure color swatches
|
## Configure color swatches
|
||||||
|
|
||||||
Add a custom array of swatches to your config/default.json.
|
Add a custom array of swatches to your config/default.json.
|
||||||
**You need to include black (#000000) and transparent (rgba(0,0,0,0)) in your custom swatches palette.**
|
|
||||||
|
**You should include the swatch transparent (rgba(0,0,0,0)) so users can remove the color applied.**
|
||||||
|
|
||||||
|
## Configure default colors
|
||||||
|
You can define text, stroke and fill color in your config/default.json.
|
||||||
|
|
||||||
|
**You also should include the default colors in your custom swatches palette.**
|
||||||
|
|
||||||
```json
|
```json
|
||||||
...
|
...
|
||||||
"spacedeck": {
|
"spacedeck": {
|
||||||
"swatches": [
|
"default_text_color": "#E11F26",
|
||||||
{"id":8, "hex":"#000000"},
|
"default_stroke_color": "#9E0F13",
|
||||||
{"id":30, "hex":"rgba(0,0,0,0)"},
|
"default_fill_color": "#64BCCA",
|
||||||
{"id":31, "hex": "#E11F26"},
|
"swatches": [
|
||||||
{"id":32, "hex": "#9E0F13"},
|
{"id":8, "hex":"#000000"},
|
||||||
{"id":33, "hex": "#64BCCA"},
|
{"id":30, "hex":"rgba(0,0,0,0)"},
|
||||||
{"id":34, "hex": "#40808A"},
|
{"id":31, "hex": "#E11F26"},
|
||||||
{"id":35, "hex": "#036492"},
|
{"id":32, "hex": "#9E0F13"},
|
||||||
{"id":36, "hex": "#005179"},
|
{"id":33, "hex": "#64BCCA"},
|
||||||
{"id":37, "hex": "#84427E"},
|
{"id":34, "hex": "#40808A"},
|
||||||
{"id":38, "hex": "#6C3468"},
|
{"id":35, "hex": "#036492"},
|
||||||
{"id":39, "hex": "#F79B84"},
|
{"id":36, "hex": "#005179"},
|
||||||
{"id":40, "hex": "#B57362"},
|
{"id":37, "hex": "#84427E"},
|
||||||
{"id":41, "hex": "#E7D45A"},
|
{"id":38, "hex": "#6C3468"},
|
||||||
{"id":42, "hex": "#ACA044"}
|
{"id":39, "hex": "#F79B84"},
|
||||||
]
|
{"id":40, "hex": "#B57362"},
|
||||||
}
|
{"id":41, "hex": "#E7D45A"},
|
||||||
|
{"id":42, "hex": "#ACA044"}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -109,6 +109,10 @@ var SpacedeckSections = {
|
|||||||
color_picker_hue: 127,
|
color_picker_hue: 127,
|
||||||
color_picker_opacity: 255,
|
color_picker_opacity: 255,
|
||||||
|
|
||||||
|
default_text_color: ENV.options.default_text_color ? ENV.options.default_text_color : "#000000",
|
||||||
|
default_stroke_color: ENV.options.default_stroke_color ? ENV.options.default_stroke_color : "#000000",
|
||||||
|
default_fill_color: ENV.options.default_fill_color ? ENV.options.default_fill_color : "#000000",
|
||||||
|
|
||||||
swatches: ENV.options.swatches ? ENV.options.swatches : [
|
swatches: ENV.options.swatches ? ENV.options.swatches : [
|
||||||
{id:1, hex:"#ff00ff"},
|
{id:1, hex:"#ff00ff"},
|
||||||
{id:2, hex:"#ffff00"},
|
{id:2, hex:"#ffff00"},
|
||||||
@@ -922,10 +926,10 @@ var SpacedeckSections = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.hide_toolbar_props();
|
this.hide_toolbar_props();
|
||||||
// reset active_style to black for new creation of artifacts
|
// reset active_style to defaults for new creation of artifacts
|
||||||
this.active_style.text_color = "#000000";
|
this.active_style.text_color = this.default_text_color;
|
||||||
this.active_style.stroke_color = "#000000";
|
this.active_style.stroke_color = this.default_stroke_color;
|
||||||
this.active_style.fill_color = "#000000";
|
this.active_style.fill_color = this.default_fill_color;
|
||||||
|
|
||||||
document.getSelection().removeAllRanges();
|
document.getSelection().removeAllRanges();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user