Installations
npm install color-parse
Developer Guide
Typescript
Yes
Module System
ESM, UMD
Node Version
20.8.1
NPM Version
10.1.0
Score
99.7
Supply Chain
87.4
Quality
80
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
colorjs
Download Statistics
Total Downloads
86,626,485
Last Day
157,499
Last Week
718,574
Last Month
3,143,106
Last Year
36,180,847
GitHub Statistics
52 Stars
86 Commits
9 Forks
5 Watching
3 Branches
10 Contributors
Bundle Size
5.16 kB
Minified
2.27 kB
Minified + Gzipped
Package Meta Information
Latest Version
2.0.2
Package Id
color-parse@2.0.2
Unpacked Size
20.47 kB
Size
5.61 kB
File Count
8
NPM Version
10.1.0
Node Version
20.8.1
Publised On
15 Mar 2024
Total Downloads
Cumulative downloads
Total Downloads
86,626,485
Last day
-6.7%
157,499
Compared to previous day
Last week
-13.7%
718,574
Compared to previous week
Last month
4.7%
3,143,106
Compared to previous month
Last year
92.5%
36,180,847
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Dev Dependencies
1
color-parse
Fast and compact color string parser.
$ npm install color-parse
1var parse = require('color-parse') 2 3parse('hsla(12 10% 50% / .3)') 4// { space: 'hsl', values: [12, 10, 50], alpha: 0.3 }
Parsed strings
- Color keywords:
red
,green
etc., see color-name -
#RGB[A]
-
#RRGGBB[AA]
-
rgb[a](R, G, B[, A])
-
rgb(R G B[ / A])
-
hsl[a](H, S, L[, A])
, inc. named hues -
hsl(H S L [ / A])
-
hwb(H, W, B)
-
cmyk(C, M, Y, K)
-
xyz(X, Y, Z)
-
luv(L, U, V)
-
luv(L U V[ / A])
-
lab(L, A, B)
-
lab(L a b[ / A])
- see limits -
lch(L, C, H)
-
lch(L C H[ / A])
- see limits -
oklab(L a b[ / A])
- see limits -
oklch(L C H[ / A])
- see limits -
color(space c1 c2 c3[ / A])
-
R:10 G:20 B:30
-
(R10 / G20 / B30)
-
C100/M80/Y0/K35
-
[10, 20, 20]
as RGB -
10,20,20
as RGB -
0x00ff00
,0x0000ff
numbers as RGB
Not parsed
- unknown strings eg.
'yellowblue'
- not strings: object, arrays etc.
Related
- color-space — collection of color space conversions.
- color-rgba — convert any color string to rgba array.
- color-alpha — change alpha component of any color.
Analogs
- parse-color — parser by @substack. Performs calculations to every possible space, which bloats size.
- color-parser — parser by @tjholowaychuk. Supports limited set of spaces.
- color-string — parsing/serializing module by Heather Arthur. Has extensive API for parsing and serializing from any to any space.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
4 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.js.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/colorjs/color-parse/test.js.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.js.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/colorjs/color-parse/test.js.yml/master?enable=pin
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 1 out of 1 npmCommand dependencies pinned
Reason
Found 2/23 approved changesets -- score normalized to 0
Reason
1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/test.js.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 11 are checked with a SAST tool
Score
3.2
/10
Last Scanned on 2025-02-03
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