1.3.0 • Published 10 years ago

opaline v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 years ago

opaline Build Status Coverage Status

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 palette
  • md: Material Design color palette
  • flat: Flat color palette
  • clrs: 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.

License

MIT © Maxime Le Conte des Floris

1.3.0

10 years ago

1.1.1

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago