color-formatter
v0.1.2
Published
Convert colors to different formats with ease
Downloads
4
Maintainers
Readme
Color Converter
Convert colors of different formats with ease
Install
npm install --save color-converter
Usage
const Color = require('color-converter');
const rgb = '255, 68, 133';
const hex = '#F8E100';
Color.getType(rgb)
// => 'rgb'
Color.toRGB(hex)
// => '248, 225, 0'
// OR
// Second argument of true means we want the output as an array
Color.toRGB(hex, true);
// => [248, 255, 0]
// You can also convert to hex
Color.toHex(rgb);
// => #FF4485
License
MIT © Josh Ghent