Define which colors to be used in color picker

Topic summary

A user is seeking a way to create a color picker in a section that only allows selection from a predefined set of globally-defined colors, rather than an open color picker. This would apply across all custom sections.

Initial Response:

  • Another user suggested passing a color value in the default attribute with a code example showing color, ID, label, and default hex value fields.

Clarification:

  • The original poster clarified they want to restrict choices to a limited set (3-4 specific colors), similar to a select box functionality, rather than having full color picker freedom.

Status: The question remains open, as the suggested solution doesn’t address the core requirement of limiting color options to a predefined palette.

Summarized with AI on November 24. AI used: claude-sonnet-4-5-20250929.

Hi,

is there any way in a section to define a color picker, only to choose from colors defined globally,

to be used on all custom sections?

thanks

Hello @Rasmus-sorensen ,

Pass the color in default attribute

{
  "type": "color",
  "id": "color_heading",
  "label": "Headings",
  "default": "#3d4246"
}

Hi,

I was more looking for a set of colors to choose from. So it is locked to 3 or 4 colors to pick from.
Something like a select box (might be the solution)