
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
simple color operations
toHSL(color)Convert a color specified as an RGBA array into an HSL object.
| parameter | type | description |
|---|---|---|
color | Array | rgba color |
Returns Object, hsl representation of that color
rgb(r, g, b)Given an r, g, b color, return a 4-element RGBA array
| parameter | type | description |
|---|---|---|
r | number | red |
g | number | green |
b | number | blue |
Returns Array, rgba array
rgba(r, g, b, a)Given an rgba color as number-like objects, return that array with numbers if possible, and null otherwise
| parameter | type | description |
|---|---|---|
r | number | red |
g | number | green |
b | number | blue |
a | number | alpha |
Returns Array, rgba array
hsl(h, s, l)Given an HSL color as components, return an RGBA array with 100% alpha
| parameter | type | description |
|---|---|---|
h | number | hue |
s | number | saturation |
l | number | luminosity |
Returns Array, rgba color
hsla(h, s, l, a)Given an HSL color as components, return an RGBA array
| parameter | type | description |
|---|---|---|
h | number | hue |
s | number | saturation |
l | number | luminosity |
a | number | alpha |
Returns Array, rgba color
hue(color)Get the hue component of a color
| parameter | type | description |
|---|---|---|
color | Color |
Returns Number, hue
saturation(color)Get the saturation component of a color as a string representing percentage
| parameter | type | description |
|---|---|---|
color | Color |
Returns String, saturation
lightness(color)Get the lightness component of a color as a string representing percentage
| parameter | type | description |
|---|---|---|
color | Color |
Returns String, lightness
alpha(color)Get the alpha component of a color
| parameter | type | description |
|---|---|---|
color | Array |
Returns Number, alpha
saturate(color, amount)Saturate or desaturate a color by a given amount
| parameter | type | description |
|---|---|---|
color | Color | |
amount | Number |
Returns Color, color
lighten(color, amount)Lighten or darken a color by a given amount
| parameter | type | description |
|---|---|---|
color | Color | |
amount | Number |
Returns Color, color
fade(color, amount)Fade a color by a given amount
| parameter | type | description |
|---|---|---|
color | Color | |
amount | Number |
Returns Color, color
spin(color, degrees)Rotate the hue of a color by an amount given in decimal degrees.
| parameter | type | description |
|---|---|---|
color | Color | |
degrees | Number |
Returns Color, output
mix(color1, color2, degrees)Mix two colors.
| parameter | type | description |
|---|---|---|
color1 | Color | |
color2 | Color | |
degrees | Number |
Returns Color, output
Requires nodejs.
$ npm install color-ops
$ npm test
FAQs
simple color operations
The npm package color-ops receives a total of 4 weekly downloads. As such, color-ops popularity was classified as not popular.
We found that color-ops demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 29 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.