@neos21/ccc : Colour Code Converter

NPM Version GPR Version

Demo

CLI

Installation

$ npm install -g @neos21/ccc

How To Use

# Colour Code
$ ccc 39c        # -> 51,153,204
$ ccc ff8000     # -> 255,128,0
$ ccc '#007AFF'  # -> 0,122,255

# RGB Code
$ ccc 0 128 255  # -> #0080ff
$ ccc 255,30,48  # -> #ff1e30

API

Installation

$ npm install --save @neos21/ccc

How To Use

const ccc = require('@neos21/ccc');

// Colour Code
ccc('39c');          // -> [ 51, 153, 204 ]
ccc('ff8000');       // -> [ 255, 128, 0 ]
ccc('#007AFF');      // -> [ 0, 122, 255 ]

// RGB Code
ccc('0, 128, 255');  // -> '#0080ff'
ccc([255, 30, 48]);  // -> '#ff1e30'

Links