-
Notifications
You must be signed in to change notification settings - Fork 682
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
[css-color-4] a new property to limit to a specific color gamut #10038
Comments
So to clarify, this is a gamut map on all computed color values, before the mapping to the actual display? |
Yes. |
Would the default value be |
I think it must be If authors want to limit to a specific gamut then they must state so explicitly. |
Thanks for confirming @romainmenke! |
Would this property define how colors outside the specified gamut are gamut mapped into it? Does it apply to all elements? Can it be animated? |
I imagine so, yes. Not much use in guaranteeing predictable colors if different browsers can still render differently.
Yes, it would need to.
I don't see a compelling reason to allow that. It should just animate discretely. |
Same here, just wanted to check. |
Thinking about this more, this same property could also be an opt-out of gamut mapping. Values could be:
Where:
If clipping is valuable to some an opt-out could be a way to move forwards. |
I think we would need multiple values, with some shorthands. Essentially, we are defining a path to a color that can be displayed on a user's device, so we need For instance-
Instead of This does raise the burden on implementers to implement multiple algorithms, mapping to multiple gamuts. |
see : #9449 (comment)
@ccameron-chromium said :
This comment was made in the context of gamut mapping for colors when those colors go beyond the device capability.
While I don't agree with that line of thinking, I do think there is something here and I want to explore it from a different perspective.
There is a disconnect between:
Authors can easily write CSS that produces color values that are outside specific color gamuts.
With interpolation, animations, relative color, ... this can often happen without the author noticing at the time of writing that specific code.
Should it be possible for authors to force a document and/or element to gamut map all colors to a specific gamut?
Maybe through a new property :
Authors would then be able to use things like interpolation in
lch
without having to worry about unexpected outcomes on future hardware.It gives you access to the color models behind
oklch
,lch
, ... without having to think about what happens when values go beyond your design constraints.The text was updated successfully, but these errors were encountered: