mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
LibWeb: Add stop-color as a CSS property
(This is to set the color of a stop for an SVG gradient)
This commit is contained in:
parent
f099ee3d47
commit
297d8eebcd
7 changed files with 86 additions and 2 deletions
|
@ -818,4 +818,15 @@ String StyleProperties::grid_area() const
|
|||
return value->as_string().to_string().release_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
Color StyleProperties::stop_color() const
|
||||
{
|
||||
auto value = property(CSS::PropertyID::StopColor);
|
||||
if (value->has_color()) {
|
||||
// FIXME: This is used by the SVGStopElement, which does not participate in layout,
|
||||
// so can't pass a layout node (so can't resolve some colors, e.g. palette ones or currentColor)
|
||||
return value->to_color({});
|
||||
}
|
||||
return Color::Black;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue