rrggbb-to-vtrgb
v0.1.1
Published
Transform HTML-style color codes into three lines of comma-separated decimal numbers, suitable for vtrgb. (man 1 setvtrgb)
Downloads
1
Readme
rrggbb-to-vtrgb
Transform HTML-style color codes into three lines of comma-separated decimal numbers, suitable for vtrgb. (man 1 setvtrgb)
API
This module exports one function:
vtrgb(colors)
colors
should be an array or string with color codes in RRGGBB
hexadecimal format.
Color codes may optionally be prefixed with #
(U+0023 number sign).
The string can use space and/or comma as separator.
Returns an array [r, g, b]
, where r
is a string that consists of
each color's red component, glued together with commas.
g
is likewise for the green components, and b
for the blue components.
Usage
see the tests.
Known issues
- Needs more/better tests and docs.
License
ISC