-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The definiton of xyz
in color-api vs. css-color specs
#24
Comments
Well spotted. This is nt inadvertent. Let me explain the history and reasoning. Any SDR color conversion library is going to need, internally, a relative XYZ D50 and a relative XYZ D65. If it extends to HDR (for BT.2100 PQ, or Jzazbz, or ICtCp) it is going to also need an absolute XYZ D65. If it deals with color spaces that use a different whitepoint, such as DCI P3 or ACES Cg, it will also need relative XYZ with those whitepoints. The question then becomes which of these to expose as an XYZ space for direct setting and for reading - for example to compute luminance, to do WCAG 2.1 contrast, and so on. A good implementation will also notice the source and destination whitepoints and avoid naively converting between D65 and D50 each time. In CSS Color 4 I went with relative D50 XYZ, primarily for ICC compatibility and for consistency with D50 Lab; both are used as profile connection spaces in ICC v.4 processing. In color.js all of the XYZs mentioned above are available internally; relative XYZ D50 and absolute XYZ D65 are exposed. This has the unfortunate effect that some behind the scenes chromatic adaptation is needed to get D65 luminances, for WCAG contrast computations of SVG filter effects and masking. As you spotted, and thanks for noticing, in the color API I am thinking that a relative XYZ D65 is a more useful thing to expose. It avoids doing a CAT for contrast calculations, and for interconverting between most RGB spaces is what will be used internally. If that turns out to be the best compromise, and given that |
The existence of these various XYZ options, at least internally, is the reason for Add diagram for colorspace conversion |
Thanks for the explanation, @svgeesus. The reasons you mention (common base for most RGB color spaces, WCAG luminance/contrast computation, etc.) point to D65 relative XYZ as the more useful of the two. I believe having the same identifier for it in |
There should definitely be a plain |
I'm not certain |
It is supported in Safari Technical Preview and in BFO Publisher (WPT test results). But yes, it is safe to assume usage is low and confined to experimentation. |
Just an update that Safari 15 shipped last week with |
Now resolved in CSS Color 4 so |
In the CSS Color Module Level 4 spec,
xyz
is a predefined color space corresponding to CIEXYZ with a D50 illuminant. The color-api spec mentionsxyz
as the connection space between SDR color spaces. The README in this repo hints it corresponds to the "D65 relative CIE XYZ" color space.Should these two definitions be harmonized?
The text was updated successfully, but these errors were encountered: