A simple to use color code converter. Supports RGB and HEX color formats.
For programmatically usage install colcon locally:
npm install colcon --save
For global usage install it globally:
npm install colcon -g
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]
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:
Converts a HEX or RGB color code. Returns object of colors.
Checks if given string is a valid RGB color code. Returns boolean.
Checks if given string is a valid HEX color code. Returns boolean.
Converts a given string to a RGB color code. If the string isn´t a valid color code, returns `false`
Converts a given string to a HEX color code. If the string isn´t a valid color code, returns `false`
- 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