Gathering detailed insights and metrics for color-string
Gathering detailed insights and metrics for color-string
Gathering detailed insights and metrics for color-string
Gathering detailed insights and metrics for color-string
npm install color-string
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.6
Supply Chain
85.1
Quality
77.8
Maintenance
100
Vulnerability
100
License
JavaScript (88.64%)
TypeScript (11.36%)
Total Downloads
4,545,112,077
Last Day
1,384,476
Last Week
23,492,561
Last Month
101,324,283
Last Year
995,417,923
MIT License
217 Stars
129 Commits
66 Forks
9 Watchers
2 Branches
27 Contributors
Updated on Jun 30, 2025
Minified
Minified + Gzipped
Latest Version
2.0.1
Package Id
color-string@2.0.1
Unpacked Size
10.44 kB
Size
3.40 kB
File Count
5
NPM Version
10.9.2
Node Version
20.5.1
Published on
Feb 14, 2025
Cumulative downloads
Total Downloads
Last Day
-5.6%
1,384,476
Compared to previous day
Last Week
-6.2%
23,492,561
Compared to previous week
Last Month
4.6%
101,324,283
Compared to previous month
Last Year
25.2%
995,417,923
Compared to previous year
1
library for parsing and generating CSS color strings.
1npm 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%)"
MIT
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
branch protection is not maximal on development and all release branches
Details
Reason
Found 6/26 approved changesets -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
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
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
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