mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:17:36 +00:00
LibWeb: Implement linear-gradient()
transition hints
These allow you to specify the point were the gradient transitions from one color to the next (without a transition hint the transition occurs at the point 50% of the way between the two colors). There is a little bit of guesswork in this implementation as the specification left out how hints work with the color stop fixup, though it appears that they are treated the same as color stops.
This commit is contained in:
parent
4f83b70c7f
commit
b205cf967d
2 changed files with 55 additions and 20 deletions
|
@ -17,6 +17,7 @@ namespace Web::Painting {
|
|||
struct ColorStop {
|
||||
Gfx::Color color;
|
||||
float position = 0;
|
||||
Optional<float> transition_hint = {};
|
||||
};
|
||||
|
||||
using ColorStopList = Vector<ColorStop, 4>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue