Replies: 3 comments 3 replies
-
The Space objects have ranges for their coords. Spaces with no actual gamut will often use > new Color('red').space.coords.r.range
[ 0, 1 ]
> new Color('red').to('lab').space.coords.l.range
undefined
> new Color('red').to('lab').space.coords.l.refRange
[ 0, 100 ] As for XYZ, there is no real defined gamut for it. It can represent any color, even imaginary colors. |
Beta Was this translation helpful? Give feedback.
-
That fills in the gaps. I didn't see (wasn't looking for) a ColorSpace I see that the The Wikipedia article on XYZ, to which the Supported Color Spaces page for Color.js links, refers to [0-1] ranges. Would that be the non-imaginary range for Thanks for all the info. Edit: Now I see that the Color.js color picker app uses 0-100 for x,y, and z. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the heads up. Yea, I started with an rgb color then switched the I assume that For my purposes I can simply default to [0, 1] for the range. I won't be enforcing anything, just formatting the numbers in a tabular way, numbers I'll be getting from Color.js. The only user input is text that goes through |
Beta Was this translation helpful? Give feedback.
-
I don't see a property anywhere to do it.
ColorSpace.prototype.inGamut()
would seem to access those values, though I don't understand themeta
variable. Is there a public property were I can get the min and max for each of the 3 parameters in a ColorSpace? In the moment I want it for number formatting,toFixed()
andpadStart()
to fix numeric display at 5 characters aligned right. For example:A side question: The docs page for supported spaces displays no ranges for the
xyz
color spaces. Why is that?Beta Was this translation helpful? Give feedback.
All reactions