color.js: new Color("--acescg").space.coords[i].range does not match coordinates of actual colors
This color.js docs entry illustrates it: https://colorjs.io/docs/spaces#acescg
The range listed for each coordinate is 0 – 65,504.
Yet the color.js picker converts CSS “darkred” to color(--acescg 0.158 0.018 0.005), which is what I see when debugging a test page.
Based on the range values for acescc, -0.36 – 1.47, and the fact that color.js produces the correct display() color in lab(), I assume that it’s the range values that are wrong, not the coordinates for the acescg color space. But this official page says the range is correct:
https://docs.acescentral.com/specifications/acescg/
Is acescg using 0 – 1 as its range for coordinates? Something is amiss. I have tried this with a variety of colors and all the coordinates are in the 0 – 1 range.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 30 (20 by maintainers)
@Myndex - thanks for your concern for my interface, but it’s not exactly mission critical stuff. It’s one of currently three web pages for testing and demonstrating my js animation library, which for non-CSS-supported spaces uses Color.js to do the animation interpolation. I’ll be posting a link to it in a discussion group here at github/color.js sometime soon…
The user inputs start and end color values the same way as in the Color.js color picker app, as a CSSish string. Then they select one or two color spaces (you can compare the way two different spaces interpolate the same line between start and end colors). It displays the start, end, and current coordinates for each space in a max 5-character format. I want it to fit in a vertical/portrait mobile screen, thus the limit on the precision of the coordinates. Underlying, unformatted float values are available via a button that copies all the animation values by frame to the clipboard in a tab-delimited format so that I can paste them into a spreadsheet to validate them.
So it won’t be perfect, but it will certainly be good enough for displayable colors according to CSS, your browser, and Color.js, in that order. Here’s a screenshot of the “controls” part of the page with some surrounding canvas that shows the midpoint of a linear animation/interpolation between these two colors across a98rgb vs jzczhz:
As for the reading list and other info, I’ll take a look at it and hopefully digest it well. Thanks.