node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

coloriss

Coloriss Build Status

RGB | Hex converter. Easy to implement for both client-side or server-side services.

Installation

You can install it manually or using some dependencies managers. Using npm:

npm install --save coloriss

Using bower:

bower install --save coloriss

Usage

Using in a node.js script

var Coloriss = require('coloriss');
 
var cs = new Coloriss('#fff');
 
console.log(cs.hex()); // output: "#FFFFFF" 
console.log(cs.rgb()); // output: {r:255, g:255, b:255} 
console.log(cs.rgb(true)); // output: "rgb(255, 255, 255)" 

Or directly in a javascript script

<script>
 
    var Coloriss = new Coloriss('#fff');
    ...
    cs.hex();
 
</script>

Demo

See a little demo of Coloriss implementation here: Demo Page

License

Coloriss is