KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How can I create a canvas gradient that goes from left to right as opposed to top to down? var lingrad = ctx.createLinearGradient(0,0,0,150); lingrad.addColorStop(0, '#00ABEB'); lingrad.addColorStop(0.5, '#fff'); lingrad.addColorStop(0.5, '#66CC00'); lingrad.addColorStop(1, '#fff'); ctx.fillStyle = lingrad; ctx.fillRect(10,10,780,130); That one goes from top to down, what do I need to do to change that to go from left to right?
Tags (comma-separated)
Save Edits
Cancel