Skip to content

Instantly share code, notes, and snippets.

@VictorCoding
Created January 2, 2017 01:11

Revisions

  1. Victor Ramos created this gist Jan 2, 2017.
    8 changes: 8 additions & 0 deletions sphere.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    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();