LibWeb/CSS: Add fixme for sRGB color interpolation

Corresponds to a0a9886063
This commit is contained in:
Sam Atkins 2025-06-16 15:41:22 +01:00
parent 046d1169de
commit 1435480d76
Notes: github-actions[bot] 2025-06-17 11:40:11 +00:00

View file

@ -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();