This article presents possible use cases and corresponding sample flows that you can support. It provides a useful starting point as you plan your implementation.
A color setting in your component's settings holds either a theme color ID, such as color_4, when the Wix user picks a color from the site's theme, or a color value that the Wix user entered, such as #333333. This flow turns the setting into a color value you can use in CSS.
To resolve a theme color ID to a color value, follow these steps:
Read the color setting from your own component's settings object:
Check whether the setting is a theme color ID. Anything else is already a color value:
Look up the ID in colors. The lookup gives undefined when the site's theme doesn't have that ID, so fall back to a default color:
Use the color while the component renders. Reading colors during the render, rather than once when the component mounts, makes the component follow theme changes:
To draw a chart in the site theme colors, follow these steps:
Read colorsMap while the component renders, so the component renders again when the theme changes:
Draw the chart in an effect that depends on themeColors, so it redraws only when the theme or the data changes. Fall back to a default color for any index the theme doesn't have. drawChart(), sales and canvasRef are your own charting function, data and canvas ref:
Render the canvas that the effect draws on:
Last updated: 13 October 2026