This PR adds the ability for the users to add their custom color schemes via the Settings panel. These color schemes are available globally and can be referenced by their user-defined key.
The UI could definitely use some improvement, but for now I think it's better than nothing and can be iterated upon.
The users can add custom color schemes by adding a key and a valid array. They can also delete their custom schemes, but not the default one. Inputs are validated for these rules:
Must have a name
Must provide a valid color array
Documentation is included.
Testing instructions
Positive case
Open Obsidian Settings > Heatmap Calendar
Make sure the default color scheme is available there and can't be deleted.
Input a color scheme name.
Input a color array.
Click the plus button.
Make sure the new color scheme appears in the UI.
Try using the color scheme in your data as mentioned in the docs.
Negative case
Repeat steps 1–2 above.
Click on the plus button.
A validation error should appear on the colors array input.
Try to input invalid JSON or an array of strings which are not valid CSS colors.
A validation error should appear on the colors array input.
Input a valid array.
Click on the plus button.
A validation error should appear on the colors name input.
This PR adds the ability for the users to add their custom color schemes via the Settings panel. These color schemes are available globally and can be referenced by their user-defined
key
.The UI could definitely use some improvement, but for now I think it's better than nothing and can be iterated upon.
The users can add custom color schemes by adding a
key
and a valid array. They can also delete their custom schemes, but not the default one. Inputs are validated for these rules:Documentation is included.
Testing instructions
Positive case
Obsidian Settings > Heatmap Calendar
default
color scheme is available there and can't be deleted.Negative case