-
Notifications
You must be signed in to change notification settings - Fork 707
[css-color] Working Color Space #300
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
Comments
Should the initial value be "auto"? Safari 10 seems to implement something like that. It means that on sRGB monitors, the working colorspace is sRGB. On P3 monitors, the working colorspace is P3. Edit: actually, I'm not sure what Safari does. But, it is able to show P3 images correctly on P3 monitors without a working colorspace at-rule. |
That doesn't require a working colorspace. Things like interpolation and compositing of colors from different spaces are where this is needed. The initial value, for Web-compat reasons, will be sRGB (because that is what is currently used). |
Is that because when no interpolation / composition is needed, we can just do: Presuming that's the case, it means that converting from the input to the output space is something that can happen late in the pipeline, well after computed or even used values. In which case the resolved value (result of getComputedStyle()) would presumably be the same as the specified value. This also seems fine when it comes to compositing. However, when it comes to interpolation (gradients, animations...), this looks like something that you should be able to resolve at computed value time, as it does not depend on layout, much less painting or compositing. And that means it should affect the computed value and the result of getComputedStyle() somehow. So how do we spec that? do we say that the computed and used values are the specified values, even in the cases where they will be used as inputs for an interpolation, but that when a property is set to a color that is the result of an interpolation (e.g. because of an animation / transition), then it is set to the right color in the working color space at computed value time? Note: this relates to #871, #741, #480, #867, #883 (at least) |
The CSS Working Group just discussed
The full IRC log of that discussion
|
The Working Group just discussed
The full IRC log of that discussion<eae> Topic: Color<Chris_> github: https://github.com//issues/300 <eae> Chris_: This issue is about making computations on color boundaries. <eae> Chris_: If used in a gradient, transitions, animations, etc. <eae> Chris_: Right now, by default, given that we've never had anything outside of srgb, is that it happens in srgb which is unfortunate. You'll end up with the wrong color due to the gamma curve. <eae> Chris_: We've had several resolutions where we don't have the right color space. <eae> Chris_: In April we discussed this and someone suggested a linear 16 bit color space. <eae> Chris_: That would allow colors outisde of the srgb gamma to be expressed. Another option would be to have it be unbounded. <leaverou> s/outisde of the srgb gamma/outisde of the srgb gamut/ <eae> Chris_: I'd like to push this forward to have spec text about this. <eae> Chris_: There will be people here at 3:30 that are exerts in this and will have an in-depth dicussion about it. <eae> Chris_: One of the reasons I started this community group is to get expert input - should help the spec move forward. <eae> I don't have a better proposal yet. Does anyone have any thoughts on this? <dbaron> q+ <eae> pkerr: You need to do you calculations in a linear space. Whether it is sRGB or float-16 that gives you the same flexibility but with better math <eae> pkerr: Gives an infine space between 0 and 1 <eae> Chris_: The movie industry likes having absolute values defined. <eae> pkerr: Linear pixels is the way to go. <astearns> ack bkardell_ <astearns> ack dbaron <smfr> q+ <eae> dbaron: One comment: I'm fine with putting stuff in spec that isn't quite sure yet but please stick a note on it to explain that/ <dbaron> ack next <eae> smfr: You can't change the color space to be linear without breaking stuff. A lot of pages have assumptions that would break. Authors needs to opt in. <Rossen> q? <eae> pkerr: When I said use linear I meant use it for the math and then convert back, not necessarily switching everything to linear. <eae> RESOLVED: Chris to do more work :) |
Has this gone anywhere? I made a demo of color blending issues to demonstrate the need for this as well as the filter version of this property. Forefox renders to-spec while Chrome uses sRGB even for SVG filters (which should use RGB by default). |
The choice of which representation of linear space to use should probably be left unspecified (probably to be implemented as whatever's native on the platform in question) as all the operations currently used on colors are isomorphic over conversion between different linear spaces. The only caveat should be that tests should allow for enough imprecision for platforms that use float16. |
OK, more work done. To catch up on this long-standing issue: There cannot be a per-document or even per-element
Also the need for a working colorspace for serialization was removed, serialized value is in the colorspace it was declared. |
In consequence, related issues are being or have been raised on other specs. Color 4 says how to specify, resolve, and serialize the colors. Combining them is handled on the appropriate spec as mentioned above, and does not affect Color 4. Thus, this issue can finally be closed. |
https://drafts.csswg.org/css-color/#working-color-space
The text was updated successfully, but these errors were encountered: