mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-03 17:02:56 +00:00
LibWeb: Return correct computed value for lab-like and lch-like colors
This commit is contained in:
parent
e860dd4f65
commit
4283c73d02
Notes:
github-actions[bot]
2025-04-20 16:44:55 +00:00
Author: https://github.com/tcl3
Commit: 4283c73d02
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4403
Reviewed-by: https://github.com/shannonbooth
3 changed files with 312 additions and 0 deletions
|
@ -595,6 +595,11 @@ static RefPtr<CSSStyleValue const> resolve_color_style_value(CSSStyleValue const
|
|||
{
|
||||
if (style_value.is_color_function())
|
||||
return style_value;
|
||||
if (style_value.is_color()) {
|
||||
auto& color_style_value = static_cast<CSSColorValue const&>(style_value);
|
||||
if (first_is_one_of(color_style_value.color_type(), CSSColorValue::ColorType::Lab, CSSColorValue::ColorType::OKLab, CSSColorValue::ColorType::LCH, CSSColorValue::ColorType::OKLCH))
|
||||
return style_value;
|
||||
}
|
||||
|
||||
return CSSColorValue::create_from_color(computed_color, ColorSyntax::Modern);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue