mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-21 07:29:53 +00:00
LibWeb: Implement the color-interpolation
property for SVG gradients
This changes the operating color space for gradient `<linearGradient>` and `<radialGradient>` elements.
This commit is contained in:
parent
040ccc3b42
commit
ad06ac0d58
Notes:
github-actions[bot]
2025-08-17 08:52:13 +00:00
Author: https://github.com/tcl3
Commit: ad06ac0d58
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5869
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/gmta ✅
29 changed files with 192 additions and 13 deletions
|
@ -66,6 +66,19 @@ SpreadMethod SVGGradientElement::spread_method_impl(HashTable<SVGGradientElement
|
|||
return SpreadMethod::Pad;
|
||||
}
|
||||
|
||||
Gfx::InterpolationColorSpace SVGGradientElement::color_space() const
|
||||
{
|
||||
switch (computed_properties()->color_interpolation()) {
|
||||
case CSS::ColorInterpolation::Linearrgb:
|
||||
return Gfx::InterpolationColorSpace::LinearRGB;
|
||||
case CSS::ColorInterpolation::Auto:
|
||||
case CSS::ColorInterpolation::Srgb:
|
||||
return Gfx::InterpolationColorSpace::SRGB;
|
||||
}
|
||||
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
Optional<Gfx::AffineTransform> SVGGradientElement::gradient_transform() const
|
||||
{
|
||||
HashTable<SVGGradientElement const*> seen_gradients;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue