{"dist":{"shasum":"fd44dc0110647ee3bd531dd678e98be0bc76568b","tarball":"https://registry.npmjs.org/colorgrad/-/colorgrad-0.1.0.tgz","integrity":"sha512-DpPem5DaEAAlxtUkbJ5+Qd7DiBiYNrsPvutLpBBJsVCp4+7z5EHQiukSxVsP594Pm3Dua7KGozldiq1EAbv8Vw==","signatures":[{"sig":"MEQCICsqVR9bDqFVl0VzBbwZhsh7JanA0ZRxjYBw9ec3ClOCAiA6gIPJIfCewSYrJXMU2I7piY7p3goiemDrvNyIRwipMw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"colorgrad.js","name":"colorgrad","author":{"name":"Ben Postlethwaite"},"readme":"The node module [color](https://github.com/harthur/color) is a better module for most things. Building out linear luminosity increases and decreases was needed for my project so I wrote this thing. If you have a central color or end point colors and want a color map array which linearly increases or decreases away from it, this is a helpful module. It also does't care if you chuck in rgb or hex, it just spits out whatever you put in. For example:\n\n```javascript\nvar cg =  require('./colorgrad')()\n\nvar cops = {\n  \"lum\": -1\n, \"nshades\": 10\n, \"type\": \"linear\"\n}\n\nvar cglwr = cg.colorgrad('#0000FF', '#FFFFFF',cops)\nvar cgupr = cg.colorgrad('#FFFFFF', '#FF0000',cops)\n\ncglwr.pop() // pop off centre duplicate\nvar c = cglwr.concat(cgupr)\nconsole.log(c)\n```\nwhich outputs\n\n```bash\n[ '#0000ff',\n  '#1c1cff',\n  '#3939ff',\n  '#5555ff',\n  '#7171ff',\n  '#8e8eff',\n  '#aaaaff',\n  '#c6c6ff',\n  '#e3e3ff',\n  '#ffffff',\n  '#ffe3e3',\n  '#ffc6c6',\n  '#ffaaaa',\n  '#ff8e8e',\n  '#ff7171',\n  '#ff5555',\n  '#ff3939',\n  '#ff1c1c',\n  '#ff0000' ]\n```\n\nRight now the only style of progression is linear, though I would like to implement exponential and square root.\nThe defaults are `nshades = 100`, `type = linear`, `lum = 1`.\nThe `lum` option sets the percentage total luminosity increase. The luminosity step size is lum / number of steps. For rgb input it would look like:\n\n```javascript\nvar ops = {\n  \"lum\": 10\n, \"nshades\": 10\n}\n\nvar cga = cg.colorgrad([10,10,10], ops)\n\nconsole.log(cga)\n```\nwhich outputs\n```bash\n[ [ 10, 10, 10 ],\n  [ 21, 21, 21 ],\n  [ 32, 32, 32 ],\n  [ 43, 43, 43 ],\n  [ 54, 54, 54 ],\n  [ 66, 66, 66 ],\n  [ 77, 77, 77 ],\n  [ 88, 88, 88 ],\n  [ 99, 99, 99 ],\n  [ 110, 110, 110 ] ]\n```\n\n\n## Install\n```bash\n$ npm install colorgrad\n```\n\nYou can put colorgrad in the browser using [browserify](https://github.com/substack/node-browserify)\n","license":"MIT","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"bpostlethwaite","email":"post.ben.here@gmail.com"},"keywords":["color","luminosity","colorarray"],"repository":{"url":"https://github.com/bpostlethwaite/colorgrad.git","type":"git"},"_npmVersion":"1.1.66","description":"Quick and easy linear color mappings","maintainers":[{"name":"bpostlethwaite","email":"post.ben.here@gmail.com"}],"readmeFilename":"README.md","_id":"colorgrad@0.1.0","version":"0.1.0"}