Comparing version 1.0.0 to 1.0.1
@@ -62,3 +62,3 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
this.rgb = this.hex2rgb(); | ||
this.hsl = this.rgb2hsl(); | ||
this.hsl = this.hex2hsl(); | ||
} else if (Array.isArray(color)) { | ||
@@ -309,3 +309,3 @@ this.setColorFromArray(color); | ||
var max = Math.max(r, g, b); | ||
var d = max - min; | ||
var delta = max - min; | ||
@@ -319,11 +319,11 @@ var h = 0; | ||
case r: | ||
rate = (g - b) / d; | ||
rate = !delta ? 0 : (g - b) / delta; | ||
h = 60 * rate; | ||
break; | ||
case g: | ||
rate = (b - r) / d; | ||
rate = (b - r) / delta; | ||
h = 60 * rate + 120; | ||
break; | ||
case b: | ||
rate = (r - g) / d; | ||
rate = (r - g) / delta; | ||
h = 60 * rate + 240; | ||
@@ -344,3 +344,3 @@ break; | ||
} else { | ||
s = l < 0.5 ? d / (2 * l) : d / (2 - 2 * l); | ||
s = l < 0.5 ? delta / (2 * l) : delta / (2 - 2 * l); | ||
} | ||
@@ -347,0 +347,0 @@ |
@@ -66,3 +66,3 @@ 'use strict'; | ||
this.rgb = this.hex2rgb(); | ||
this.hsl = this.rgb2hsl(); | ||
this.hsl = this.hex2hsl(); | ||
} else if (Array.isArray(color)) { | ||
@@ -313,3 +313,3 @@ this.setColorFromArray(color); | ||
var max = Math.max(r, g, b); | ||
var d = max - min; | ||
var delta = max - min; | ||
@@ -323,11 +323,11 @@ var h = 0; | ||
case r: | ||
rate = (g - b) / d; | ||
rate = !delta ? 0 : (g - b) / delta; | ||
h = 60 * rate; | ||
break; | ||
case g: | ||
rate = (b - r) / d; | ||
rate = (b - r) / delta; | ||
h = 60 * rate + 120; | ||
break; | ||
case b: | ||
rate = (r - g) / d; | ||
rate = (r - g) / delta; | ||
h = 60 * rate + 240; | ||
@@ -348,3 +348,3 @@ break; | ||
} else { | ||
s = l < 0.5 ? d / (2 * l) : d / (2 - 2 * l); | ||
s = l < 0.5 ? delta / (2 * l) : delta / (2 - 2 * l); | ||
} | ||
@@ -351,0 +351,0 @@ |
{ | ||
"name": "colorizr", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Manipulate colors like a boss", | ||
@@ -5,0 +5,0 @@ "author": "Gil Barbara <gilbarbara@gmail.com>", |
@@ -45,3 +45,3 @@ // @flow | ||
this.rgb = this.hex2rgb(); | ||
this.hsl = this.rgb2hsl(); | ||
this.hsl = this.hex2hsl(); | ||
} | ||
@@ -253,3 +253,3 @@ else if (Array.isArray(color)) { | ||
const max = Math.max(r, g, b); | ||
const d = max - min; | ||
const delta = max - min; | ||
@@ -263,11 +263,11 @@ let h = 0; | ||
case r: | ||
rate = (g - b) / d; | ||
rate = !delta ? 0 : (g - b) / delta; | ||
h = 60 * rate; | ||
break; | ||
case g: | ||
rate = (b - r) / d; | ||
rate = (b - r) / delta; | ||
h = (60 * rate) + 120; | ||
break; | ||
case b: | ||
rate = (r - g) / d; | ||
rate = (r - g) / delta; | ||
h = (60 * rate) + 240; | ||
@@ -289,3 +289,3 @@ break; | ||
else { | ||
s = l < 0.5 ? d / (2 * l) : d / (2 - (2 * l)); | ||
s = l < 0.5 ? delta / (2 * l) : delta / (2 - (2 * l)); | ||
} | ||
@@ -292,0 +292,0 @@ |
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
57654