linear-gradient-parser
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "linear-gradient-parser", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Parses a SVG linear gradient string / parsed JSON into css background image property", | ||
@@ -5,0 +5,0 @@ "author": "Oded Goldglas <odedglas@gmail.com>", |
@@ -30,3 +30,3 @@ # linear-gradient-parser | ||
console.log(stringResult) | ||
//outputs : {angle: 360, background: "linear-gradient(360deg, rgb(252, 179, 164) 0%, rgb(218, 88, 153) 100%)"} | ||
//outputs : {background: "linear-gradient(0deg, rgb(252, 179, 164) 0%, rgb(218, 88, 153) 100%)", angle: 0} | ||
@@ -48,3 +48,3 @@ // JSON input | ||
console.log(jsonResult) | ||
//outputs : {angle: 360, background: "linear-gradient(360deg, rgb(252, 179, 164) 0%, rgb(218, 88, 153) 100%)"} | ||
//outputs : {background: "linear-gradient(0deg, rgb(252, 179, 164) 0%, rgb(218, 88, 153) 100%)", angle: 0} | ||
``` | ||
@@ -51,0 +51,0 @@ |
@@ -0,1 +1,3 @@ | ||
import clampAngle from '../calmpAngle'; | ||
/** | ||
@@ -35,5 +37,5 @@ * Formats a given position attribute | ||
const angleRad = Math.atan2(y, x); | ||
return (angleRad * 180 / Math.PI) + 90; | ||
return clampAngle((angleRad * 180 / Math.PI) + 90); | ||
}; | ||
export default getGradientAngle; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48819
36
751