From 1435480d76a30aacfe8e32b973ae42d404c21963 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Mon, 16 Jun 2025 15:41:22 +0100 Subject: [PATCH] LibWeb/CSS: Add fixme for sRGB color interpolation Corresponds to https://github.com/w3c/csswg-drafts/commit/a0a988606379f01917446ede6b89e83002fc148a --- Libraries/LibWeb/CSS/Interpolation.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Libraries/LibWeb/CSS/Interpolation.cpp b/Libraries/LibWeb/CSS/Interpolation.cpp index 32d5e948a8c..2819dac1506 100644 --- a/Libraries/LibWeb/CSS/Interpolation.cpp +++ b/Libraries/LibWeb/CSS/Interpolation.cpp @@ -599,6 +599,10 @@ Color interpolate_color(Color from, Color to, float delta) { // https://drafts.csswg.org/css-color/#interpolation-space // If the host syntax does not define what color space interpolation should take place in, it defaults to Oklab. + // However, user agents must handle interpolation between legacy sRGB color formats (hex colors, named colors, + // rgb(), hsl() or hwb() and the equivalent alpha-including forms) in gamma-encoded sRGB space. This provides + // Web compatibility; legacy sRGB content interpolates in the sRGB space by default. + // FIXME: Use srgb by default for these, once we can distinguish what form a color was specified in. auto from_oklab = from.to_oklab(); auto to_oklab = to.to_oklab();