Created
January 1, 2014 14:37
-
-
Save doomsbuster/8208506 to your computer and use it in GitHub Desktop.
Snap Gradients with Percentage offset values
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
var g = s.gradient("r(145,331,38)#fff:0%-rgb(75,75,123):50%-rgb(68,68,68):100%"); | |
console.log(g.toString()); | |
Output: | |
<radialGradient cx="145" cy="331" r="38"> | |
<stop offset="NaN%" stop-color="#ffffff"/> | |
<stop offset="NaN%" stop-color="#4b4b7b"/> | |
<stop offset="NaN%" stop-color="#444444"/> | |
</radialGradient> | |
var g2 = s.gradient("r(145,331,38)#fff:0-rgb(75,75,123):50-rgb(68,68,68):100"); | |
console.log(g2.toString()); | |
Output: | |
<radialGradient cx="145" cy="331" r="38"> | |
<stop offset="0%" stop-color="#ffffff"/> | |
<stop offset="50%" stop-color="#4b4b7b"/> | |
<stop offset="100%" stop-color="#444444"/> | |
</radialGradient> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment