RESOLVED FIXED Bug 233862
[CSS Color 5] Update color-mix() to support srgb-linear and alpha premultiplication
https://bugs.webkit.org/show_bug.cgi?id=233862
Summary [CSS Color 5] Update color-mix() to support srgb-linear and alpha premultipli...
Sam Weinig
Reported 2021-12-05 09:48:19 PST
Color interpolation has been updated to allow interpolation in the srgb-linear space and been clarified that mixing happens with alpha premultiplied colors.
Attachments
Patch (116.96 KB, patch)
2021-12-05 10:06 PST, Sam Weinig
no flags
Patch (117.08 KB, patch)
2021-12-06 05:47 PST, Sam Weinig
no flags
Patch (117.02 KB, patch)
2021-12-06 07:54 PST, Sam Weinig
no flags
Sam Weinig
Comment 1 2021-12-05 10:06:13 PST
Cameron McCormack (:heycam)
Comment 2 2021-12-05 19:34:23 PST
Comment on attachment 445988 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=445988&action=review I didn't look at the test changes closely. > Source/WebCore/platform/graphics/ColorInterpolation.h:282 > + WebCore::ColorInterpolationColorSpace::SRGB, > + WebCore::ColorInterpolationColorSpace::XYZD50, Missing SRGBLinear. > Source/WebCore/platform/graphics/ColorNormalization.h:64 > +template<typename ComponentType> inline ComponentType normalizeHue(ComponentType hue) > +{ > + return std::fmod(std::fmod(hue, 360.0) + 360.0, 360.0); > +} Do we want to try to stick to floats and use fmodf when ComponentType is a float?
Sam Weinig
Comment 3 2021-12-06 05:47:51 PST
Sam Weinig
Comment 4 2021-12-06 07:54:06 PST
Sam Weinig
Comment 5 2021-12-06 07:55:50 PST
(In reply to Cameron McCormack (:heycam) from comment #2) > Comment on attachment 445988 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=445988&action=review > > I didn't look at the test changes closely. > > > Source/WebCore/platform/graphics/ColorInterpolation.h:282 > > + WebCore::ColorInterpolationColorSpace::SRGB, > > + WebCore::ColorInterpolationColorSpace::XYZD50, > > Missing SRGBLinear. Fixed. > > > Source/WebCore/platform/graphics/ColorNormalization.h:64 > > +template<typename ComponentType> inline ComponentType normalizeHue(ComponentType hue) > > +{ > > + return std::fmod(std::fmod(hue, 360.0) + 360.0, 360.0); > > +} > > Do we want to try to stick to floats and use fmodf when ComponentType is a > float? This would subtly change the output of mixing to not be consistent with parsing (which uses doubles in normalization currently). We probably need to think about the use of doubles in the parsing code and decide where the appropriate point to cast down to float is and apply that holistically. Thanks for the review.
EWS
Comment 6 2021-12-06 13:58:30 PST
Committed r286568 (?): <https://commits.webkit.org/r286568> All reviewed patches have been landed. Closing bug and clearing flags on attachment 446038 [details].
Radar WebKit Bug Importer
Comment 7 2021-12-06 13:59:21 PST
Note You need to log in before you can comment on or make changes to this bug.