@daeinc/color
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -25,11 +25,12 @@ "use strict"; | ||
if (Array.isArray(hOrValOrArr)) { | ||
hOrValOrArr[0] *= 360; | ||
if (hOrValOrArr.length === 3) { | ||
const arr = [...hOrValOrArr]; | ||
arr[0] *= 360; | ||
if (arr.length === 3) { | ||
// ([h, s, v]) | ||
return [...hsvrgb(...hOrValOrArr)]; | ||
return [...hsvrgb(...arr)]; | ||
} | ||
else if (hOrValOrArr.length === 4) { | ||
else if (arr.length === 4) { | ||
// ([h, s, v, a]) | ||
// hsvrgb's 4th argument is NOT alpha but out array | ||
return [...hsvrgb(...hOrValOrArr.slice(0, 3)), hOrValOrArr[3]]; | ||
return [...hsvrgb(...arr.slice(0, 3)), arr[3]]; | ||
} | ||
@@ -36,0 +37,0 @@ } |
{ | ||
"name": "@daeinc/color", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Color utilities", | ||
@@ -5,0 +5,0 @@ "types": "./dist/index.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
12852
176