Skip to content

Commit

Permalink
LibWeb: Add a spec comment for color interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
mattco98 authored and kalenikaliaksandr committed Mar 3, 2024
1 parent 29b7048 commit f02cd4d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f02cd4d

Please sign in to comment.