Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradient spread methods #27

Open
Herschel opened this issue May 16, 2022 · 0 comments
Open

Gradient spread methods #27

Herschel opened this issue May 16, 2022 · 0 comments

Comments

@Herschel
Copy link

Herschel commented May 16, 2022

It would be useful if CanvasGradient allowed specifying a spread method, which determines how the gradient is rendered outside the [0.0, 1.0] stop range:

  • Pad (current default, gradient stop is clamped to [0.0, 1.0])
  • Repeat (gradient repeats in the same order past the edges, i.e. colors at [1.0, 2.0] would be the same as [0.0, 1.0]
  • Reflect (gradient colors repeat in reverse past the edges, i.e. colors at [1.0, 2.0] would be the reverse of [0.0, 1.0]

This would give canvas parity with spreadMethod in SVG and SpreadMethod going back to Flash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant