CSS Color Module Level 4-compliant color string parser
npm install css-color-l4css-color-l4


> CSS Color Module Level 4\-compliant color string parser
(forked from adroitwhiz/css-color and translated to TypeScript)
css-color-l4 is a CSS Color Module Level 4-compliant CSS color value parser.
It parses any color values defined in the CSS Color Module Level 4, and refuses
to parse any other values. This is to ensure complete consistency with, for
instance, web browsers. In comparison, most other JS color parsers both fail to
parse color values that browsers will accept.
Key points:
- this library is well tested around edge cases
- this library doesn't include any color conversion functionality
- The color() function syntax is currently not supported.
- currentcolor is currently not supported.
- System colors (i.e. like VisitedText) are currently not supported. (Named
colors like red are supported)
The parser function is the default export:
``js`
const parseColor = require('css-color')
`sh`
npm install css-color-l4 --saveyarn add css-color-l4
Alternatively, there are also client web builds available:
`html
`
MIT