Godrej Design Lab

Color Schemes

The website features pages with distinct color palettes. This is achieved with the Color Schemes content type. With this, one can introduce new color palettes to choose from.

Lifecycle hooks

The 1st-party @strapi/plugin-color-picker plugin adds color picker input fields. However, they capture and store values in the HEX format. The frontend code, however, expects the color values in RGB.

Hence, a lifecycle hook (at apps/cms/src/api/color-scheme/content-types/color-scheme/lifecycles.ts) has been registered where on creating/updating a color scheme entry, the captured HEX values are converted to the RGB format and stored in separate attributes that are hidden from the Strapi UI.