color-formatter

0.1.2 • Public • Published

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

Package Sidebar

Install

npm i color-formatter

Weekly Downloads

2

Version

0.1.2

License

MIT

Last publish

Collaborators

  • joshghent