Skip to content

Instantly share code, notes, and snippets.

@ajmas
Created December 24, 2015 05:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajmas/00e559254a41ee5d103b to your computer and use it in GitHub Desktop.
Save ajmas/00e559254a41ee5d103b to your computer and use it in GitHub Desktop.
Drawing a rainbow gradient with snapSVG
snap = Snap('#mySVG');
gradient = snap.gradient('l(0, 0, 1, 0)red-orange-yellow-green-blue-indigo-violet');
snap.rect(0,0,200,200).attr({
fill: gradient
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment