Color string parser
npm install color-parseFast and compact color string parser.
$ npm install color-parse
``js
var parse = require('color-parse')
parse('hsla(12 10% 50% / .3)')
// { space: 'hsl', values: [12, 10, 50], alpha: 0.3 }
`
* [x] Color keywords: red, green etc., see color-name#RGB[A]
* [x] #RRGGBB[AA]
* [x] rgba
* [x] rgb(R G B[ / A])
* [x] hsla
* [x] , inc. named hueshsl(H S L [ / A])
* [x] hwb(H, W, B)
* [x] cmyk(C, M, Y, K)
* [x] xyz(X, Y, Z)
* [x] luv(L, U, V)
* [x] luv(L U V[ / A])
* [x] lab(L, A, B)
* [x] lab(L a b[ / A])
* [x] - see limitslch(L, C, H)
* [x] lch(L C H[ / A])
* [x] - see limitsoklab(L a b[ / A])
* [x] - see limitsoklch(L C H[ / A])
* [x] - see limitscolor(space c1 c2 c3[ / A])
* [x] R:10 G:20 B:30
* [x] (R10 / G20 / B30)
* [x] C100/M80/Y0/K35
* [x] [10, 20, 20]
* [x] as RGB10,20,20
* [x] as RGB0x00ff00
* [x] , 0x0000ff numbers as RGB
* [x] unknown strings eg. 'yellowblue'`
* [x] not strings: object, arrays etc.
* color-space — collection of color space conversions.
* color-rgba — convert any color string to rgba array.
* color-alpha — change alpha component of any color.
* 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.
