Skip to content

Instantly share code, notes, and snippets.

@VictorCoding
Created January 2, 2017 01:11
Show Gist options
  • Save VictorCoding/fd85d3bfeba35b8b644b6b79cf78d26a to your computer and use it in GitHub Desktop.
Save VictorCoding/fd85d3bfeba35b8b644b6b79cf78d26a to your computer and use it in GitHub Desktop.
sphere drawn in canvas
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