As of now, color handling is based on (s)RGB internally. All conversion functions are implemented (more or less) following the reference implementations in W3C's Color Module Level 4.
Reasoning
It could possible completely replace the current ColorizerUtility function related to converting from / toRGB.
Probably higher code quality than my own implementations.
color.js aswell as culori add lots of overhead while using the tree-shakable APIs. Both of them are based around Color Spaces / Color Modes, which are - as of now - way out of scope of this application, which is intended to provide different input methods to define colors and then work with them.
Just for now, we're implementing our own interface for colors, which is tightly geared towards the specific needs of this application.
Evaluation - Part II
Ok, I gave culori another try.
culori exposes its conversion functions directly, making it suitable for tree-shaking (color.js has the conversion functions tied to classes/objects, so the resulting bundle would contain more overhead). BUT, culori does not provide a full set of conversion functions!
Everything went smooth to convert from sRGB to CIE XYZ and back, but there are no conversion functions from CIE XYZ to (i.e.) OkLCH. You would have to convert to sRGB and then to OkLCH which is a) overhead and b) might lead to rounding/calculation/precision issues.
As of now, color handling is based on (s)RGB internally. All conversion functions are implemented (more or less) following the reference implementations in W3C's Color Module Level 4.
Reasoning
ColorizerUtility
function related to converting from / toRGB
.Candidates
color.js
culori
Evaluation
color.js
aswell asculori
add lots of overhead while using the tree-shakable APIs. Both of them are based around Color Spaces / Color Modes, which are - as of now - way out of scope of this application, which is intended to provide different input methods to define colors and then work with them.Just for now, we're implementing our own interface for colors, which is tightly geared towards the specific needs of this application.
Evaluation - Part II
Ok, I gave
culori
another try.culori
exposes its conversion functions directly, making it suitable for tree-shaking (color.js
has the conversion functions tied to classes/objects, so the resulting bundle would contain more overhead). BUT,culori
does not provide a full set of conversion functions!Everything went smooth to convert from
sRGB
toCIE XYZ
and back, but there are no conversion functions fromCIE XYZ
to (i.e.)OkLCH
. You would have to convert tosRGB
and then toOkLCH
which is a) overhead and b) might lead to rounding/calculation/precision issues.