Gathering detailed insights and metrics for color-string
Gathering detailed insights and metrics for color-string
npm install color-string
Typescript
Module System
Node Version
NPM Version
99.6
Supply Chain
85.1
Quality
75.7
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
4,148,293,592
Last Day
3,677,209
Last Week
16,619,409
Last Month
74,503,598
Last Year
879,797,897
213 Stars
124 Commits
62 Forks
11 Watching
2 Branches
25 Contributors
Minified
Minified + Gzipped
Latest Version
1.9.1
Package Id
color-string@1.9.1
Unpacked Size
9.88 kB
Size
3.30 kB
File Count
4
NPM Version
8.6.0
Node Version
17.3.1
Cumulative downloads
Total Downloads
Last day
-1.3%
3,677,209
Compared to previous day
Last week
-14.9%
16,619,409
Compared to previous week
Last month
5.9%
74,503,598
Compared to previous month
Last year
13%
879,797,897
Compared to previous year
2
1
library for parsing and generating CSS color strings.
With npm:
1$ npm install color-string
1colorString.get('#FFF') // {model: 'rgb', value: [255, 255, 255, 1]} 2colorString.get('#FFFA') // {model: 'rgb', value: [255, 255, 255, 0.67]} 3colorString.get('#FFFFFFAA') // {model: 'rgb', value: [255, 255, 255, 0.67]} 4colorString.get('hsl(360, 100%, 50%)') // {model: 'hsl', value: [0, 100, 50, 1]} 5colorString.get('hsl(360 100% 50%)') // {model: 'hsl', value: [0, 100, 50, 1]} 6colorString.get('hwb(60, 3%, 60%)') // {model: 'hwb', value: [60, 3, 60, 1]} 7 8colorString.get.rgb('#FFF') // [255, 255, 255, 1] 9colorString.get.rgb('blue') // [0, 0, 255, 1] 10colorString.get.rgb('rgba(200, 60, 60, 0.3)') // [200, 60, 60, 0.3] 11colorString.get.rgb('rgba(200 60 60 / 0.3)') // [200, 60, 60, 0.3] 12colorString.get.rgb('rgba(200 60 60 / 30%)') // [200, 60, 60, 0.3] 13colorString.get.rgb('rgb(200, 200, 200)') // [200, 200, 200, 1] 14colorString.get.rgb('rgb(200 200 200)') // [200, 200, 200, 1] 15 16colorString.get.hsl('hsl(360, 100%, 50%)') // [0, 100, 50, 1] 17colorString.get.hsl('hsl(360 100% 50%)') // [0, 100, 50, 1] 18colorString.get.hsl('hsla(360, 60%, 50%, 0.4)') // [0, 60, 50, 0.4] 19colorString.get.hsl('hsl(360 60% 50% / 0.4)') // [0, 60, 50, 0.4] 20 21colorString.get.hwb('hwb(60, 3%, 60%)') // [60, 3, 60, 1] 22colorString.get.hwb('hwb(60, 3%, 60%, 0.6)') // [60, 3, 60, 0.6] 23 24colorString.get.rgb('invalid color string') // null
1colorString.to.hex([255, 255, 255]) // "#FFFFFF" 2colorString.to.hex([0, 0, 255, 0.4]) // "#0000FF66" 3colorString.to.hex([0, 0, 255], 0.4) // "#0000FF66" 4colorString.to.rgb([255, 255, 255]) // "rgb(255, 255, 255)" 5colorString.to.rgb([0, 0, 255, 0.4]) // "rgba(0, 0, 255, 0.4)" 6colorString.to.rgb([0, 0, 255], 0.4) // "rgba(0, 0, 255, 0.4)" 7colorString.to.rgb.percent([0, 0, 255]) // "rgb(0%, 0%, 100%)" 8colorString.to.keyword([255, 255, 0]) // "yellow" 9colorString.to.hsl([360, 100, 100]) // "hsl(360, 100%, 100%)" 10colorString.to.hwb([50, 3, 15]) // "hwb(50, 3%, 15%)" 11 12// all functions also support swizzling 13colorString.to.rgb(0, [0, 255], 0.4) // "rgba(0, 0, 255, 0.4)" 14colorString.to.rgb([0, 0], [255], 0.4) // "rgba(0, 0, 255, 0.4)" 15colorString.to.rgb([0], 0, [255, 0.4]) // "rgba(0, 0, 255, 0.4)"
Stable Version
1
5.3/10
Summary
Regular Expression Denial of Service (ReDOS)
Affected Versions
< 1.5.5
Patched Versions
1.5.5
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 4/26 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More