Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
fuzzy-color
Advanced tools
Fuzzy color is a utility that takes a string and does its absolute best to parse a meaningful color value from it.
Fuzzy color is a utility that takes a string and does its absolute best to parse a meaningful color value from it. It takes all the everyday color formats plus a few rarer ones that are (unfortunately) out there.
rgb(0, 0, 0)
rgba(0, 0, 0, 0)
#000
#000000
#000000
R:0 G:0 B:0
(R0 / G0 / B0)
There is also an 'assume' mode. When the assume parameter is passed we can parse values like 0 0 0
and assume they
are a certain color format. Some examples would be rgb
, hsl
, hsv
. If there are 4 numbers
(0 0 0 0.5
) it will always assume it is rgba
.
npm install fuzzy-color
var fuzzycolor = require('fuzzy-color');
var color1 = fuzzycolor('rgb(34,210,222)');
console.log(color1);
// { string: 'rgb(34,210,222)', raw: [ 34, 210, 222 ], type: 'rgb' }
var color2 = fuzzycolor('34, 210, 222', 'hsv');
console.log(color2);
// { string: 'hsv(34,210,222)', raw: [ 34, 210, 222 ], type: 'hsv' }
MIT
FAQs
Fuzzy color is a utility that takes a string and does its absolute best to parse a meaningful color value from it.
The npm package fuzzy-color receives a total of 1 weekly downloads. As such, fuzzy-color popularity was classified as not popular.
We found that fuzzy-color 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.