color-rgba
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -12,4 +12,2 @@ /** @module color-rgba */ | ||
if (typeof color !== 'string') throw Error('Argument should be a string') | ||
//attempt to parse non-array arguments | ||
@@ -16,0 +14,0 @@ var parsed = parse(color) |
{ | ||
"name": "color-rgba", | ||
"version": "2.0.0", | ||
"description": "Convert color string to rgba array", | ||
"version": "2.1.0", | ||
"description": "Convert color string (or parseable argument) to RGBA array", | ||
"main": "index.js", | ||
@@ -21,3 +21,3 @@ "scripts": { | ||
], | ||
"author": "ΔY <dfcreative@gmail.com>", | ||
"author": "Dmitry Yv <dfcreative@gmail.com>", | ||
"license": "MIT", | ||
@@ -30,5 +30,5 @@ "bugs": { | ||
"clamp": "^1.0.1", | ||
"color-parse": "^1.3.5", | ||
"color-parse": "^1.3.7", | ||
"color-space": "^1.14.6" | ||
} | ||
} |
10
test.js
@@ -13,2 +13,3 @@ const assert = require('assert') | ||
assert.deepEqual(rgba('hsla(109, 50%, 50%, .75)'), [87.125, 191.25, 63.75, .75]) | ||
assert.deepEqual(rgba('#f00'), [255, 0, 0, 1]) | ||
@@ -18,5 +19,6 @@ assert.deepEqual(rgba('xyz'), []) | ||
assert.throws(() => { | ||
rgba([1,1,1,1]) | ||
rgba(new Uint8Array([255, 255, 255, 255])) | ||
}) | ||
assert.deepEqual(rgba(0x00ff00), [0, 255, 0, 1]) | ||
assert.deepEqual(rgba(new Number(0x00ff00)), [0, 255, 0, 1]) | ||
assert.deepEqual(rgba([1,1,1,1]), [1,1,1,1]) | ||
assert.deepEqual(rgba(new Uint8Array([255, 255, 255, 255])), [255,255,255,1]) |
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
4499
Updatedcolor-parse@^1.3.7