1.3.0 • Published 8 years ago
opaline v1.3.0
opaline
Gives you quick access to colors from popular palettes.
See also opaline-cli.
Install
Ensure you have Node.js version 6+ installed. Then run the following:
$ npm install --save opaline
Usage
const opaline = require('opaline');
opaline.hex('md', 'red', 'a200');
//=> '#FF5252'
opaline.rgb('ios', 'yellow');
//=> 'rgb(255, 204, 0)'
opaline.raw('flat', 'green');
//=> { r: 46, g: 204, b: 113, hex: 2ECC71 }
API
.hex(palette, color, hue)
Get the hex value.
'#FFFFFF'
.rgb(palette, color, hue)
Get the rgb value.
'rgb(255, 255, 255)'
.raw(palette, color, hue)
Get the raw rgb and hex value (as an object).
{ r: 255, g:255, b:255, hex: 'FFFFFF' }
palette
Type: string
Name of the color palette. Possible values:
ios
: iOS color palettemd
: Material Design color paletteflat
: Flat color paletteclrs
: Colors.css palette
color
Type: string
Name of the color.
hue
Type: string
Default: 500
Because some color palettes (like Material Design) have "hues", you can specify the color hue.
Contributing
Remarks, advices & contributions are welcome. Feel free to open an issue or submit a pull request.