Created
January 2, 2017 01:11
-
-
Save VictorCoding/fd85d3bfeba35b8b644b6b79cf78d26a to your computer and use it in GitHub Desktop.
sphere drawn in canvas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gradient = ctx.createRadialGradient(50, 30, 0, 40, 40, 50); | |
gradient.addColorStop(0, 'white'); | |
gradient.addColorStop(1, 'black'); | |
ctx.fillStyle = gradient; | |
ctx.beginPath(); | |
ctx.arc(40, 40, 40, 0, Math.PI * 2); | |
ctx.fill(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment