color code coverter
npm install lissa-color-converternpm i lissa-color-convertat the top of your file put:
``ts`
const lissaColor = require('lissa-color-convert');
valid input and output values:
- "name" for web color name
- "hex" for hex code
- "rgb" for rgb values
examples:
`js`
lissaColor.convert([0, 206, 209], "rgb", "name");
// returns "darkturquoise"
`js`
lissaColor.("ghostwhite", "name", "hex");
// returns "#f8f8ff"
`js``
lissaColor.("#4b0082", "hex", "rgb");
// returns [75, 0, 130]
- if web color input name does not exist, null is returned
- if input color code is incorrectly formatted, null is returned
- if no existing web color is equal to the input color, undefined is returned