I have a plethora of colors stored in JSON format. I am utilizing rootbeer with gulp to convert them into Sass maps for processing by SCSS:
{ "blue": "33A2FF" }
into
$colors: ( "blue": "33A2FF" );
I am able to use the colors effectively using the #{}
syntax, but when color functions like lightness()
are applied, the compiler fails because the color type is lost.
Even attempting to work with unquote()
doesn't allow Sass to recognize this as anything other than a string, when it actually needs to be recognized as a color.
My inquiry is whether there exists a method to compel the compiler to acknowledge this as a color instead? Escaping all uses of the built-in color functions could be an alternative solution.
Another possibility would involve rewriting all colors as RGB values, with separate parameters for R, G, and B, then employing the rgb()
syntax to interpret them as colors, as discussed here. However, this option would necessitate a substantial overhaul. Perhaps someone has a suggestion on resolving this dilemma.