8000 Correct values for semi-transparent hex colors by mattsarett · Pull Request #8153 · flutter/flutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Correct values for semi-transparent hex colors #8153

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

Closed
wants to merge 1 commit into from

Conversation

mattsarett
Copy link
Contributor

Hex colors are typically encoded with the sRGB transfer function.

In this case, the values specified here translate directly to
SkColors (which are defined by Skia to be sRGB).

Therefore, the value corresponding to N% of a color is actually
255 * LinearToSRGB(N / 100).

This CL corrects that logical error.

In the short term, this will make blacks appear darker and whites
appear lighter. Once color correct Skia is enabled, the colors
will look similar to how they appear now (though this is
dependent on the background).

#8152

Hex colors are typically encoded with the sRGB transfer function.

In this case, the values specified here translate directly to
SkColors (which are defined by Skia to be sRGB).

Therefore, the value corresponding to N% of a color is actually
255 * LinearToSRGB(N / 100).

This CL corrects that logical error.

In the short term, this will make blacks appear darker and whites
appear lighter.  Once color correct Skia is enabled, the colors
will look similar to how they appear now (though this is
dependent on the background).
@mattsarett
Copy link
Contributor Author

@chinmaygarde
@brianosman

@mattsarett
Copy link
Contributor Author

Oops, this doesn't make any sense. Please disregard.

@mattsarett mattsarett closed this Feb 14, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0