-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
relative colors when origin is beyond gamut of output #32704
Comments
Nothing in particular happens.
is equivalent to
There is no gamut mapping at any of the intermediate stages. In practice this means that you get exactly the channel values you would expect. We associate You can play around with the channel values here : https://preset-env.cssdb.org/blog/relative-color-syntax-channel-values/ |
Re-reading the title I think I understand the question better :) The result of a value described with relative color syntax is a The output that you see when inspecting computed values in a browser is a serialization of the underlying This is also exactly why relative colors and |
The current relative color PR doesn't mention examples like: what happens if we have In this example, I am assuming this oklch is beyond the scope of We don't have any examples in the relative color documentation showing how to handle the calculations. Basically, using pseudo-code, and assuming --foo is beyond the scope of being represented by
We have explained 1 fully in the current PR, 2 can be inferred from that PR. 3 is not explained in #32004, . How would we calculate/show adding |
There isn't any difference between 1, 2 and 3.
The Having a single example that is within the p3 gamut but outside srgb would be good. Staying within the p3 gamut is important because browsers haven't shipped gamut mapping (yet) and there is no need to complicate things further for authors. For example :
The resulting value will be equivalent to :
Also theoretically equivalent to |
@chrisdavidmills I think we should add the example in #32704 (comment) to the "using relative colors" page, but definitely not to the other page. what say you? |
Once the PR #32004 is merged, but we should address the following :
What happens if you do a relative color with the origin color being outside the gamut of the function? For example, if you use a custom property of a fantastically vibrant magenta using
oklab()
and add opacity usingrgb()
as the output. In this case, only thealpha
value changed, but I assume the origin color is converted tocolor(srgb)
rather thanrgb()
, which doesn't matter in the alpha case, but does matter if the value ofb
is changed.Originally posted by @estelle in #32004 (comment)
The text was updated successfully, but these errors were encountered: