-
Notifications
You must be signed in to change notification settings - Fork 10
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
Swapped sRGB linearization implementations #6
Comments
@domyd is correct - the math in the map() functions of the
PR#12 includes the following fix for this issue. (@james-alex does not seem to be monitoring this repo any more so I will place the corrected versions here for anyone interested in patching it themselves.) at end of file
|
Support Flutter 3.x wide gamut changes, Fix okLab<->RGB conversions (gamma correction math was swapped), Fixes james-alex#9, Fixes james-alex#6
Hello! In
color_converter.dart
,linearize
andnormalize
are each doing the opposite of what they're supposed to do.normalize
turns the color into a linear space, andlinearize
turns it into gamma-compressed sRGB. See https://en.wikipedia.org/wiki/SRGB#Transformation.I noticed this since
OklabColor
was seemingly giving me the wrong colors, and I tracked it down to this :)If you want, I can submit a PR to fix this.
The text was updated successfully, but these errors were encountered: