Problem/Motivation
Following the work started in #3257274: Implement color changing theme settings for Olivero and #788332: Provide a parser for THEME.colors.yml, it seems Drupal could benefit from utilizing a 3rd party library that can convert colors between various formats (e.g. hex codes, hsl, rgb).
From @alexpott's MR comments on the Olivero color picker:
I think given we're storing this in config I think maybe we should be storing the hsl value and not the hex. Since we need to call this for every html page served. ... we'd then need an hsl to rbg converter function to convert from the hsl function in config to rgb for the color picker. Ho hum.
Proposed resolution
Add spatie/color as a composer dependency of core. It has no run-time dependencies and is MIT licensed
At this point I'm not sure what else would be required, but I wanted to get the discussion going on this topic.
Comments