{"name":"chartjs-color","version":"2.2.0","description":"Color conversion and manipulation with CSS string support","keywords":["color","colour","css"],"authors":["Heather Arthur <fayearthur@gmail.com>","Maxime Thirouin","Josh Junon"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/chartjs/chartjs-color.git"},"xo":{"envs":["browser","node"],"rules":{"one-var":[2,{"initialized":"never"}],"linebreak-style":0,"no-cond-assign":0,"new-cap":0}},"files":["CHANGELOG.md","LICENSE","index.js"],"scripts":{"pretest":"xo","test":"mocha"},"dependencies":{"color-convert":"^0.5.3","chartjs-color-string":"^0.5.0"},"devDependencies":{"browserify":"^10.1.3","gulp":"^3.8.11","gulp-rename":"^1.2.2","gulp-uglify":"^1.2.0","gulp-streamify":"^1.0.2","mocha":"^2.2.5","vinyl-source-stream":"^1.1.0","xo":"^0.12.1"},"gitHead":"afb9254edef475c8cc6091da3eea2d5e1691068d","bugs":{"url":"https://github.com/chartjs/chartjs-color/issues"},"homepage":"https://github.com/chartjs/chartjs-color#readme","_id":"chartjs-color@2.2.0","_shasum":"84a2fb755787ed85c39dd6dd8c7b1d88429baeae","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.4","_npmUser":{"name":"chartjs-ci","email":"chartjs-ci@abysscorp.org"},"dist":{"shasum":"84a2fb755787ed85c39dd6dd8c7b1d88429baeae","tarball":"http://registry-npm.ywwl.com/chartjs-color/download/chartjs-color-2.2.0.tgz","integrity":"sha512-lmrNe4fRXbMK+9Iwuhx+pH686RGZZRZKJuJ5xUctCqtRDgoluqxEe3TiDstWfuppDt1LTSEMR6bU4xW5IYdwNA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBPgx/a29AGrI3zHkRueeEhpRVinNhAXyIQKcGTRuMQ9AiEAuPTYeZTe3axiFEoVIaeG132/BjqZE0LtWqitbdQdjSc="}],"size":5908,"noattachment":false,"key":"/chartjs-color/-/chartjs-color-2.2.0.tgz"},"maintainers":[{"name":"chartjs-ci","email":"chartjs-ci@abysscorp.org"},{"name":"tannerlinsley","email":"tannerlinsley@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chartjs-color-2.2.0.tgz_1504989443911_0.7779163443483412"},"directories":{},"readme":"# chartjs-color\n\n[![npm](https://img.shields.io/npm/v/chartjs-color.svg?style=flat-square)](https://npmjs.com/package/chartjs-color) [![Travis](https://img.shields.io/travis/chartjs/chartjs-color.svg?style=flat-square)](https://travis-ci.org/chartjs/chartjs-color)\n\n> JavaScript library for color conversion and manipulation with support for CSS color strings.\n\n```js\nvar color = Color(\"#7743CE\");\n\ncolor.alpha(0.5).lighten(0.5);\n\nconsole.log(color.hslString());  // \"hsla(262, 59%, 81%, 0.5)\"\n```\n\n## Install\n\n```console\n$ npm install color\n```\n\n## Usage\n\n```js\nvar Color = require(\"color\")\n```\n\n### Setters\n\n```js\nvar color = Color(\"rgb(255, 255, 255)\")\nvar color = Color({r: 255, g: 255, b: 255})\nvar color = Color().rgb(255, 255, 255)\nvar color = Color().rgb([255, 255, 255])\n```\nPass any valid CSS color string into `Color()` or a hash of values. Also load in color values with `rgb()`, `hsl()`, `hsv()`, `hwb()`, and `cmyk()`.\n\n```js\ncolor.red(120)\n```\nSet the values for individual channels with `alpha`, `red`, `green`, `blue`, `hue`, `saturation` (hsl), `saturationv` (hsv), `lightness`, `whiteness`, `blackness`, `cyan`, `magenta`, `yellow`, `black`\n\n### Getters\n\n\n```js\ncolor.rgb()       // {r: 255, g: 255, b: 255}\n```\nGet a hash of the rgb values with `rgb()`, similarly for `hsl()`, `hsv()`, and `cmyk()`\n\n```js\ncolor.rgbArray()  // [255, 255, 255]\n```\nGet an array of the values with `rgbArray()`, `hslArray()`, `hsvArray()`, and `cmykArray()`.\n\n```js\ncolor.red()       // 255\n```\nGet the value for an individual channel.\n\n### CSS Strings\n\n```js\ncolor.hslString()  // \"hsl(320, 50%, 100%)\"\n```\n\nDifferent CSS String formats for the color are on `hexString`, `rgbString`, `percentString`, `hslString`, `hwbString`, and `keyword` (undefined if it's not a keyword color). `\"rgba\"` and `\"hsla\"` are used if the current alpha value of the color isn't `1`.\n\n### Luminosity\n\n```js\ncolor.luminosity();  // 0.412\n```\nThe [WCAG luminosity](http://www.w3.org/TR/WCAG20/#relativeluminancedef) of the color. 0 is black, 1 is white.\n\n```js\ncolor.contrast(Color(\"blue\"))  // 12\n```\nThe [WCAG contrast ratio](http://www.w3.org/TR/WCAG20/#contrast-ratiodef) to another color, from 1 (same color) to 21 (contrast b/w white and black).\n\n```js\ncolor.light();  // true\ncolor.dark();   // false\n```\nGet whether the color is \"light\" or \"dark\", useful for deciding text color.\n\n### Manipulation\n\n```js\ncolor.negate()         // rgb(0, 100, 255) -> rgb(255, 155, 0)\n\ncolor.lighten(0.5)     // hsl(100, 50%, 50%) -> hsl(100, 50%, 75%)\ncolor.darken(0.5)      // hsl(100, 50%, 50%) -> hsl(100, 50%, 25%)\n\ncolor.saturate(0.5)    // hsl(100, 50%, 50%) -> hsl(100, 75%, 50%)\ncolor.desaturate(0.5)  // hsl(100, 50%, 50%) -> hsl(100, 25%, 50%)\ncolor.greyscale()      // #5CBF54 -> #969696\n\ncolor.whiten(0.5)      // hwb(100, 50%, 50%) -> hwb(100, 75%, 50%)\ncolor.blacken(0.5)     // hwb(100, 50%, 50%) -> hwb(100, 50%, 75%)\n\ncolor.clearer(0.5)     // rgba(10, 10, 10, 0.8) -> rgba(10, 10, 10, 0.4)\ncolor.opaquer(0.5)     // rgba(10, 10, 10, 0.8) -> rgba(10, 10, 10, 1.0)\n\ncolor.rotate(180)      // hsl(60, 20%, 20%) -> hsl(240, 20%, 20%)\ncolor.rotate(-90)      // hsl(60, 20%, 20%) -> hsl(330, 20%, 20%)\n\ncolor.mix(Color(\"yellow\"))        // cyan -> rgb(128, 255, 128)\ncolor.mix(Color(\"yellow\"), 0.3)   // cyan -> rgb(77, 255, 179)\n\n// chaining\ncolor.green(100).greyscale().lighten(0.6)\n```\n\n### Clone\n\nYou can can create a copy of an existing color object using `clone()`:\n\n```js\ncolor.clone() // -> New color object\n```\n\nAnd more to come...\n\n## Propers\n\nThe API was inspired by [color-js](https://github.com/brehaut/color-js). Manipulation functions by CSS tools like Sass, LESS, and Stylus.\n","publish_time":1504989444858,"_cnpm_publish_time":1504989444858,"dist-tags":{"latest":"2.4.1"}}