color-palette-panel - add possibility to "group" colors #47837
Description
What problem does this address?
Right now the ColorPalettePanel
groups colors via PaletteEdit
into the hardcoded 2 groups "Theme" and "Default", but it is not possible to introduce custom grouping. This could become handy when having many custom colors and starting to group them by branding or usage.
Theme
Those are comming from the theme.json
via settings.color.palette
in following format:
{
"settings": {
"color": {
"palette": [
{
"slug": "primary",
"color": "#7c027c",
"name": "Purple"
}
]
}
}
}
Defaults
Those are default colors which can also be deactivated via theme.json
via settings.color.defaultPalette: false
What is your proposed solution?
We could simply extend the settings.color.palette
by introducing a new "group"-key to the color settings. This way we were able to add some grouping on the ColorPalettePanel
to have better seperation:
{
"settings": {
"color": {
"palette": [
{
"slug": "purple",
"color": "#7c027c",
"name": "Purple"
"group": "Product XYZ Branding"
},
{
"slug": "lavender",
"color": "#E6E6FA",
"name": "A different purple"
"group": "Product ABC Branding"
},
{
"slug": "fuchsia",
"color": "#FF00FF",
"name": "Default purpleish"
}
]
}
}
}
The output would looks like following:
We have 3 groups: The 2 custom ones "Product XYZ Branding" and "Product ABC Branding" and additonally the 1 color which has no group defaults to "Theme":
Metadata
Assignees
Labels
Type
Projects
Status
Todo
Activity