Drawing gradients doesn't work
See original GitHub issueExpected Behaviour
- When using
createLinearGradient
, should work
Actual Behaviour
- c.createLinearGradient is not a function
Steps To Reproduce
- Copy the code from https://joshmarinacci.github.io/node-pureimage/test-file/specs/gradientfill.test.js.html#lineNumber3
- Run
Any Relevant Code Snippets
var PImage = require('pureimage');
let image = PImage.make(20,20)
let c = image.getContext('2d');
c.fillStyle = 'black'
c.fillRect(0,0,200,200)
const grad = c.createLinearGradient(0,0,20,20)
grad.addColorStop(0,'white')
grad.addColorStop(1,'blue')
Platform
OS: Windows 10, Ubuntu 18 Node Version: v10.15.0 NPM Version: 6.13.7 PureImage Version: 0.1.6
Any Additional Info
Its definately in the code base: https://github.com/joshmarinacci/node-pureimage/blob/1d4bdd54e1e4f1b3ed9f94cb90c639bfbe078cd3/src/context.js
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Solved: illustrator gradient tool not working? - 8570511
Fill the shape with a gradient first, then use the tool. ... I select the gradient (not the tool) and the color doesn't...
Read more >Gradient tool in Adobe Illustrator not working - YouTube
Update: I figured it out, the circle shape was (for some reason) having issues (even after "expanding" or making it a compound shape),...
Read more >NEED HELP!! Have a problem with gradients. - Inkscape
But my gradients don't work. I was drawing a white button, but when I use a gradients, it all turn to black!! Does...
Read more >How To Draw Gradients With The Gradient Tool In Photoshop
Drawing A Gradient With The Gradient Tool Simply click in your document to set a starting point for the gradient, then keep your...
Read more >Gradient tool issues - Illustrator UserVoice
Gradient tool doesn't work when applying the same gradient across multiple objects. If you try to adjust the gradient it will simply just ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This should be fixed now with release 0.3.13
I spent some time looking at gradients with stroke() and was able to get it working for what I need.
I can’t say that I understand the code well enough to propose a pull request but my changes are described below.
This did work for strokeRect, lineTo and arc
These are the changes that worked for me: