Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

color-rgba

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

color-rgba - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

2

index.js

@@ -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)

8

package.json
{
"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"
}
}

@@ -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])
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc