summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Painting/GradientPainting.h
AgeCommit message (Collapse)Author
2022-08-23LibWeb: Resolve double-position `linear-gradient()` color stopsMacDue
These just resolve to an extra color stop. Something like "red 10% 40%" is just shorthand for "red 10%, red 40%".
2022-08-18LibWeb: Support painting `repeating-linear-gradient()`sMacDue
2022-08-12LibWeb: Implement `linear-gradient()` transition hintsMacDue
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.
2022-08-08LibWeb: Convert images to common AbstractImageStyleValue baseMacDue
This commit moves both the ImageStyleValue and LinearGradientStyleValue to a common base class of AbstractImageStyleValue. This abstracts getting the natural_width/height, loading/resolving, and painting the image. Now for 'free' you get: - Linear gradients working with the various background sizing/repeat properties. - Linear gradients working as list-markers :^) -- best feature ever! P.s. This commit is a little large as it's tricky to make this change incrementally without breaking things.
2022-07-18LibWeb: Add GradientPainting for painting linear-gradientsMacDue
This implements support for painting linear-gradients in a spec correct way :^). Right now it supports: - Multi-stop gradients - Color stop fixups - Using pre-multiplied alpha mixing when required - Painting gradients at arbitrary angles It still needs to support: - Transition hints - Double position color stops However what is implemented now seems to be accurate to other browsers, and covers the most common use cases.