Gathering detailed insights and metrics for simple-color-converter
Gathering detailed insights and metrics for simple-color-converter
Gathering detailed insights and metrics for simple-color-converter
Gathering detailed insights and metrics for simple-color-converter
ts-color-converter
TsColorConverter is a TypeScript library for converting between various color formats (HEX, RGB, RGBA, HSL, HSLA, HSB, HSBA). It provides a simple and consistent API for color manipulation and conversion.
color-converter-qwynbleid
Simple javascript color converter
@apiverve/colorconverter
Color Converter is a simple tool for converting color formats. It returns the color converted to the specified format.
got-color
Simple HEX --> RGB Converter
This is a simple colors converter packaged as a npm package
npm install simple-color-converter
Typescript
Module System
Min. Node Version
Node Version
NPM Version
76.1
Supply Chain
98.4
Quality
76
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
144,005
Last Day
7
Last Week
654
Last Month
3,344
Last Year
47,000
MIT License
21 Stars
58 Commits
2 Forks
1 Watchers
19 Branches
1 Contributors
Updated on Apr 15, 2025
Minified
Minified + Gzipped
Latest Version
2.1.13
Package Id
simple-color-converter@2.1.13
Unpacked Size
54.94 kB
Size
14.49 kB
File Count
18
NPM Version
6.14.6
Node Version
12.18.3
Cumulative downloads
Total Downloads
Last Day
-12.5%
7
Compared to previous day
Last Week
-26.3%
654
Compared to previous week
Last Month
-24.9%
3,344
Compared to previous month
Last Year
55.6%
47,000
Compared to previous year
1
4
It covers most colors formats from Pantone, Ral, Hex 3/4/6/8, HTML, sRgb, CMYK, etc for converting from -> and -< to. It's designed with simplicity in mind. you can pass data and specify the format or just let is guess what color you are trying to pass as string.
$ npm install simple-color-converter
1const simpleColorConverter = require('simple-color-converter'); 2 3var color = new simpleColorConverter({ 4 ral: { ral: 3009 }, 5 to: 'cmyk' 6}) 7 8console.log(color) // { c: 0, m: 53, y: 60, k: 60 }
Expected input value list [here].
Expected output value list [here].
color system | object | array | string |
---|---|---|---|
cmyk | {c: 39, m: 0, y: 39, k: 7} | [39, 0, 39.7] | 'cmyk 39 0 39 7' |
grayscale | '78' | ||
hex3 | '#9E9' | ||
hex4 | '#9E9F' | ||
hex6 | '#90EE90' | ||
hex8 | '#90EE90FF' | ||
html | 'Light Green' | ||
hsl | { h: 120, s: 73.4, l: 74.9 } | [120, 73.4, 74.9] | 'hsl 120 73.4 74.9' |
hsv | { h: 120, s: 39.4, l: 93.3 } | [120, 39.4, 93.3] | 'hsl 120 39.4 93.3' |
lab | {l: 86.5, a: -46.3, b: 36.9} | [86.5, -46.3, 36.9] | 'lab 86.5 -46.3 36.9' |
pantone | {name: '358C'} | 'pantone 358C' | |
ral | { ral : 6019 } | 'ral 6019' | |
rgb | { r: 144, g: 238, b: 144 } | [144, 238, 144] | 'rgb 144 238 144' |
rgba | { r: 144, g: 238, b: 144, a: 1 } | [144, 238, 144, 1] | 'rgba 144 238 144 1' |
rgb decimal | 'rgb decimal 6812065' | ||
w | { r: 144, g: 238, b: 144, a: 1 } | [144, 238, 144, 1] | 'w 544' |
xyz | { x: 44, y: 69, z: 45 } | [44, 69, 45] | 'xyz 44 69 45' |
yuv | { y: 180, u: 113.2, v: 73.5 } | [ 180, 113.2, 73.5 ] | 'yuv 180 113.2 73.5' |
Any of the colors mentioned above. You can specify the color and it will be faster of just use the built in color detector.
1 2// faster 3var fasterColor = new simpleColorConverter({ 4 rgb: {r: 10, g: 200, b: 50}, 5 to: 'cmyk' 6}) 7 8// slower but more convenient 9 10var slowerColor = new simpleColorConverter({ 11 color: 'rgb 10 200 50', 12 to: 'cmyk' 13}) 14
Extra From colors | note |
---|---|
color | Autoidentify color |
hex | Autoidentify hex color |
android | hex8 |
flags are the arguments used for special modifiers. The most useful one is rendering grayscale color, but there is a debugger and a hexref flag created if you need to convert a color but also output a close hex similar color(in case of online color convertors).
1const simpleColorConverter = require('simple-color-converter'); 2 3var color = simpleColorConverter({ 4 hex3: '#228', 5 to: 'cmyk', 6 grayscale: true 7}) 8 9console.log(color) // { c: 0, m: 0, y: 0, k: 87 }
flag | output | data type | default | note |
---|---|---|---|---|
grayscale | grayscale value in the from format | boolean | false | |
hexref | Reference value in hex format | boolean | false | For Hex it equels Hex6 |
debug | this prevents the object cleanup | boolean | false |
I am working on version 3 or this package and the new version will be a modern setter and getter based color convertor. A much modern way of approaching this problem.
If there are any features you would like to support, or want to add it directly please send us a pull request. I`m more then happy.
If you have any suggestions or you spotted an aberrant behavior or bugs, don't hesitate to send me an email.
Copyright © 2019, Radu Dragan. Licensed under the MIT License.
I`m Radu, Thank you for using my color convertor, I hope it is useful for you. I genuinely excited to build this kind of solutions.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
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
Project has not signed or included provenance with any releases.
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
34 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-16
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