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

[hdom-canvas] add gradient support #43

Closed
postspectacular opened this issue Sep 12, 2018 · 0 comments
Closed

[hdom-canvas] add gradient support #43

postspectacular opened this issue Sep 12, 2018 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@postspectacular
Copy link
Member

Just recording some notes about adding linear & radial gradient support:

  1. Add SVG-like gradient def elements to construct gradient object in canvas ctx:
["linearGradient", {id: "foo", from: [0,0], to: [100,100]}, [0, "#f00"], [1, "#0cf"]]
  1. Gradient defs will need to be stored in DrawState (add gradients field)

  2. Use $ prefix for gradient refs and add special handling for stroke & fill shape attribs, i.e. to check for $foo

@postspectacular postspectacular added the enhancement New feature or request label Sep 12, 2018
@postspectacular postspectacular self-assigned this Sep 12, 2018
postspectacular added a commit that referenced this issue Sep 12, 2018
- add "linearGradient"/"radialGradient" shape types
- add defLinearGradient() & defRadialGradient()
- update mergeState(), restoreState() & setAttrib()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant