colcon

0.3.1 • Public • Published

colcon

A simple to use color code converter. Supports RGB and HEX color formats.

Table of Contents

Installation

For programmatically usage install colcon locally:

npm install colcon --save

For global usage install it globally:

npm install colcon -g

Usage

To use colcon programmatically, add something like this in your code:

var colcon = require('colcon');
 
var hex = '#f8f8f8',
    rgb = '150, 150, 150';
 
var newRgb = colcon.convert(hex);
var newHex = colcon.convert(rgb);
 
console.log('hex to rgb: ' + newRgb);
console.log('rgb to hex: ' + newHex);

For command line conversion hit:

colcon -c [color code]

API

Command line API:

Usage: colcon [options]

Options:

    -h, --help           output usage information
    -V, --version        output the version number
    -c, --color [value]  a color code like rgb or hex. If passing a hex color code, remove the leading #.

Programmatically API:

colcon.convert(value)

colcon.isRgb(value)

colcon.isHex(value)

colcon.toRgb(value)

colcon.toHex(value)

Release Notes

  • 0.3.1
    • More helpful comments
    • More helpful command line output
    • Some conversion improvements
    • Some bugfixes
  • 0.3.0
    • Some bugfixes
  • 0.2.0
    • Global usage is now available
    • Some bugfixes
  • 0.1.0 Initial Release

Package Sidebar

Install

npm i colcon

Weekly Downloads

1

Version

0.3.1

License

MIT

Last publish

Collaborators

  • sydev