Closed svgeesus closed 3 years ago
Did you test that it works using http://projects.verou.me/rework-utils ?
Did you test that it works using http://projects.verou.me/rework-utils ?
No, I only tested it standalone.
There was an integration bug (coords were malformed when passed to my function) which is now fixed, it works in Rework too.
Tests whether a given P3 color (as array of three coords in range [0-1] lies within the sRGB gamut. The code first linearizes the P3 coordinates, then converts to CIE XYZ and then to linear-light sRGB. The latter two stages are combined for efficiency, and the matrix multiply is also hard-coded.