1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:48:12 +00:00

LibWeb: Add a spec comment for color interpolation

This commit is contained in:
Matthew Olsson 2024-03-02 14:21:28 -07:00 committed by Alexander Kalenik
parent 29b70485fc
commit f02cd4d0b0

View file

@ -1069,6 +1069,8 @@ static ErrorOr<NonnullRefPtr<StyleValue const>> interpolate_value(DOM::Element&
case StyleValue::Type::Angle:
return AngleStyleValue::create(Angle::make_degrees(interpolate_raw(from.as_angle().angle().to_degrees(), to.as_angle().angle().to_degrees(), delta)));
case StyleValue::Type::Color: {
// 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.
auto from_color = from.as_color().color();
auto to_color = to.as_color().color();
auto from_oklab = from_color.to_oklab();