Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
chromaticity-color-utilities
Advanced tools
Color utilities for Node.js.
Conversion, modification, and color schemes of: RGB (at any bit depth), HSV, HSL, HSI, HSP, CYMK, YIQ, XYZ, xyY, L*a*b*, L*u*v*, Y'PbPr, Y'CbCr, and more.
npm install --save chromaticity-color-utilities
The full docs contain information on each method as well as the mathematics behind them.
Full Documentation > https://reiniiriarios.github.io/chromaticity-color-utilities
Any color can be converted to any other, with only a few caveats. Construction from()
, conversion to()
, and modification modify()
methods can be chained.
Object properties can be accessed directly, e.g. color.r
for the red channel value.
Most colors will retain their arguments as a part of their object properties, such as bitDepth, colorSpace, etc.
const Color = require('chromaticity-color-utilities')
let color1 = Color.from('rgb',[255,128,0]).to('hsv')
// hsv { h: 34, s: 100, v: 88, a: 100 }
let color2 = Color.from('hex','ff3201').to('rec709rgb', { bitRate: 10 })
// rec709rgb { r: 940, g: 298, b: 67, a: 940, bitDepth: 10, max: 1023 }
let color6 = Color.from('hex', '#ff00ff').to('lab')
// defaulting to sRGB color space with a D65 standard illuminant reference white
// lab { l: 95, a: 142, b: -88 }
let color6 = Color.from('hex', 0xFF00FF).to('lab',{
colorSpace: 'AdobeRGB',
referenceWhite: 'D50'
})
// lab { l: 100, a: 150, b: -49 }
let red = Color.from('hsl',[280,80,90]).to('rgb').r
// 250
let color7 = Color.from('hsl',[300,100,50]).to('ypbpr',{kb:0.0722, kr:0.2126})
// ypbpr { y: 0.2848, pb: 0.3854278939426601, pr: 0.45415290830581667 }
let color3 = Color.from('rgb',[255,0,0]).modify('blend', {with: Color.from('rgb',[0,255,0])})
// rgb { r: 128, g: 128, b: 0, a: 255, bitDepth: 8, max: 255 }
let color4 = Color.from('rgb',[255,0,0]).modify('blend', {
with: Color.from('hex','00ff00'),
amount: 0.4
})
// rgb { r: 153, g: 102, b: 0, a: 255, bitDepth: 8, max: 255 }
let color5 = Color.from('hex','ee5432').modify('blend', {
with: Color.from('rgb',[234, 100, 20, 64]),
amount: 1/3
}).to('hsv')
// hsv { h: 15, s: 83, v: 93, a: 75 }
let scheme1 = Color.from('rgb',[200, 180, 0]).scheme('splitComplement')
// [
// rgb { r: 200, g: 180, b: 0, a: 255, bitDepth: 8, max: 255 },
// rgb { r: 0, g: 120, b: 200, a: 255, bitDepth: 8, max: 255 },
// rgb { r: 80, g: 0, b: 200, a: 255, bitDepth: 8, max: 255 }
// ]
let scheme2 = Color.from('hsl',[180, 80, 48]).scheme('tetradic', { angle: 40 })
// [
// hsl { h: 180, s: 80, l: 48, a: 100 },
// hsl { h: 220, s: 80, l: 48, a: 100 },
// hsl { h: 40, s: 80, l: 48, a: 100 },
// hsl { h: 0, s: 80, l: 48, a: 100 }
// ]
git clone https://github.com/reiniiriarios/chromaticity-color-utilities.git
cd chromaticity-color-utilities
npm install
tsc
FAQs
Color utilities for Node.js
The npm package chromaticity-color-utilities receives a total of 22 weekly downloads. As such, chromaticity-color-utilities popularity was classified as not popular.
We found that chromaticity-color-utilities demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.