Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andreruffert/crayola
:rainbow: Get Crayola Names and Color Codes.
https://github.com/andreruffert/crayola
crayola-color javascript
Last synced: 15 days ago
JSON representation
:rainbow: Get Crayola Names and Color Codes.
- Host: GitHub
- URL: https://github.com/andreruffert/crayola
- Owner: andreruffert
- License: mit
- Created: 2014-09-24T18:55:03.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-24T19:53:33.000Z (about 10 years ago)
- Last Synced: 2024-11-17T03:52:10.931Z (about 1 month ago)
- Topics: crayola-color, javascript
- Language: JavaScript
- Homepage:
- Size: 105 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# crayola [![Build Status](https://travis-ci.org/andreruffert/crayola.svg?branch=master)](https://travis-ci.org/andreruffert/crayola)
> Get Crayola Names and Color Codes
Currently 133 colors.
The Crayola Names and Color Codes are just a [JSON file](colors.json) extracted from this [article](http://www.colourlovers.com/web/blog/2008/04/22/all-120-crayon-names-color-codes-and-fun-facts).
## Install
```sh
$ npm install --save crayola
```## Usage
```js
var crayola = require('crayola');crayola();
//=> { hex: '#FEFE22', name: 'Laser Lemon', rgb: '(254, 254, 34)' }crayola().hex;
//=> #FEFE22crayola().name;
//=> Laser Lemoncrayola().rgb;
//=> (254, 254, 34)crayola.colors;
//=> [{ hex: '#FEFE22', name: 'Laser Lemon', rgb: '(254, 254, 34)'}, ...]
```## API
### crayola()
Returns a random [crayola color](colors.json).
### crayola().hex;
Returns a random crayola hex color code### crayola().name;
Returns a random crayola color name### crayola().rgb;
Returns a random crayola rgb color code### crayola.colors
Array with all the colors.
## CLI
```sh
$ npm install --global crayola
``````sh
$ crayola --helpExample
$ crayola.hex
#FF5349
$ crayola.name
Red Orange
$ crayola.rgb
(255, 83, 73)
```## License
Entirely based on [superb](https://github.com/sindresorhus/superb) by [Sindre Sorhus](http://sindresorhus.com/). MIT © [André Ruffert](http://andreruffert.com)