{"_id":"colorgrad","_rev":"7-61f9f2f3c3a38593f27ad0d3b13a8faf","name":"colorgrad","description":"Quick and easy linear color mappings","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"colorgrad","version":"0.1.0","description":"Quick and easy linear color mappings","main":"colorgrad.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/bpostlethwaite/colorgrad.git"},"keywords":["color","luminosity","colorarray"],"author":{"name":"Ben Postlethwaite"},"license":"MIT","readmeFilename":"README.md","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","_id":"colorgrad@0.1.0","dist":{"shasum":"fd44dc0110647ee3bd531dd678e98be0bc76568b","tarball":"https://registry.npmjs.org/colorgrad/-/colorgrad-0.1.0.tgz","integrity":"sha512-DpPem5DaEAAlxtUkbJ5+Qd7DiBiYNrsPvutLpBBJsVCp4+7z5EHQiukSxVsP594Pm3Dua7KGozldiq1EAbv8Vw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICsqVR9bDqFVl0VzBbwZhsh7JanA0ZRxjYBw9ec3ClOCAiA6gIPJIfCewSYrJXMU2I7piY7p3goiemDrvNyIRwipMw=="}]},"_npmVersion":"1.1.66","_npmUser":{"name":"bpostlethwaite","email":"post.ben.here@gmail.com"},"maintainers":[{"name":"bpostlethwaite","email":"post.ben.here@gmail.com"}]},"0.2.0":{"name":"colorgrad","version":"0.2.0","description":"Quick and easy linear color mappings","main":"index.js","directories":{"lib":".","example":"example","test":"test"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"https://github.com/bpostlethwaite/colorgrad.git"},"keywords":["color","luminosity","colorarray"],"author":{"name":"Ben Postlethwaite","email":"post.ben.here@gmail.com","url":"benpostlethwaite.ca"},"license":"MIT","readme":"# colorgrad\n\nQuick and easy linear color mappings\n\n[![build status](https://secure.travis-ci.org/bpostlethwaite/colorgrad.png)](https://github.com/bpostlethwaite/colorgrad)\n\nThe 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. If you put in one color it just marches `nshade` number of steps towards the luminosity increase factor you set in the options (or 100% for default). If you stick in two colors it finds the right mapping of color to get from one to the other in `nshade` steps. 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","readmeFilename":"README.md","_id":"colorgrad@0.2.0","dist":{"shasum":"e46dcdfa8118d39ca57f54f76b0eb01371f77d8a","tarball":"https://registry.npmjs.org/colorgrad/-/colorgrad-0.2.0.tgz","integrity":"sha512-00WJrZNXQiQKOhBHx3txNsWFGGFZaPGuKCeHU7zBqzswuefZuOhTvo2CCRXRxHBkJlUuB1SgpKLs54fZ5N1RaA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJk/NNnISri4NnRcwX3+wn0NEpWf5GRs75vtZqqVk7rwIgY6bD/6MQ1d3eZWu/u9evGNwbhk6oBPmqgbWQJzBpn1w="}]},"_npmVersion":"1.1.70","_npmUser":{"name":"bpostlethwaite","email":"post.ben.here@gmail.com"},"maintainers":[{"name":"bpostlethwaite","email":"post.ben.here@gmail.com"}]}},"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","maintainers":[{"name":"bpostlethwaite","email":"post.ben.here@gmail.com"}],"time":{"modified":"2022-06-13T06:31:55.737Z","created":"2012-12-13T06:55:30.354Z","0.1.0":"2012-12-13T06:55:31.696Z","0.2.0":"2013-01-29T22:00:54.530Z"},"author":{"name":"Ben Postlethwaite","email":"post.ben.here@gmail.com","url":"benpostlethwaite.ca"},"repository":{"type":"git","url":"https://github.com/bpostlethwaite/colorgrad.git"}}