{"name":"vanilla-picker","version":"2.0.2","description":"A simple, easy to use vanilla JS color picker with alpha selection.","author":{"name":"Andreas Borgen","url":"https://github.com/Sphinxxxx"},"homepage":"https://github.com/Sphinxxxx/vanilla-picker","license":"ISC","repository":{"type":"git","url":"git+https://github.com/Sphinxxxx/vanilla-picker.git"},"bugs":{"url":"https://github.com/Sphinxxxx/vanilla-picker/issues"},"main":"dist/vanilla-picker.js","module":"src/picker.js","files":["src/","dist/"],"scripts":{"prepublish":"bash ./scripts/prepub.sh","postpublish":"bash ./scripts/postpub.sh","test":"echo \"Error: no test specified\" && exit 1"},"devDependencies":{"babel-core":"^6.26.0","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.6.1","babel-register":"^6.26.0","gulp":"^4.0.0","gulp-file":"^0.4.0","gulp-header":"^2.0.1","gulp-rename":"^1.2.2","gulp-replace":"^0.6.1","gulp-strip-comments":"^2.5.2","gulp-uglify":"^3.0.0","node-sass":"^4.7.2","pug":"^2.0.0-rc.4","rollup":"^0.56.2","rollup-plugin-babel":"^3.0.3","rollup-plugin-node-resolve":"^3.0.3"},"dependencies":{"@sphinxxxx/color-conversion":"^2.0.0-alpha.3","drag-tracker":"^0.4.1"},"gitHead":"02b3f040e76a12bc6c404b5258c27b85bc2ffa73","_id":"vanilla-picker@2.0.2","_npmVersion":"5.6.0","_nodeVersion":"6.11.3","_npmUser":{"name":"sphinxxxx","email":"coding@enthuses.me"},"dist":{"integrity":"sha512-VA18Bc5ezRMiqNO91dSy3Ytjqvb1Lpxkss9lbhaEEKYaJpHT3TjALqNWrZLstJyMfHTqGxMrPsjq51GKnlSemQ==","shasum":"793f75eef2a48acd695c65d0ccd9a97bce509ca7","tarball":"http://registry-npm.ywwl.com/vanilla-picker/download/vanilla-picker-2.0.2.tgz","fileCount":12,"unpackedSize":63429,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9ZC4TAeiW513STbiJlEQBXtQrReKGhg49GMV+q2oT9wIhAJKhyEX4CwS1vW7oEloYdUuTD1d93o3k9O78Ara+hCTK"}],"size":17348,"noattachment":false,"key":"/vanilla-picker/-/vanilla-picker-2.0.2.tgz"},"maintainers":[{"name":"sphinxxxx","email":"coding@enthuses.me"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vanilla-picker_2.0.2_1522930698362_0.8764561673040738"},"_hasShrinkwrap":false,"readme":"# vanilla-picker\n\n[![License](https://img.shields.io/npm/l/vanilla-picker.svg)](https://github.com/Sphinxxxx/vanilla-picker/blob/master/LICENSE.md)\n[![Version](https://img.shields.io/npm/v/vanilla-picker.svg)](https://npmjs.com/vanilla-picker)\n[![Size](https://badgen.net/badgesize/gzip/sphinxxxx/vanilla-picker/master/dist/vanilla-picker.min.js?label=min%2Bgzip)](https://unpkg.com/vanilla-picker)\n[![Downloads](https://img.shields.io/npm/dm/vanilla-picker.svg)](https://npmjs.com/vanilla-picker)\n\nA simple, easy to use vanilla JS (no dependencies) color picker with alpha selection.\n\n#### Demo\n\nhttps://codepen.io/Sphinxxxx/pen/zRmKBX\n\n\n## Getting Started\n\n#### Installing\n\n* For the pros:\n\n  + ```npm install vanilla-picker --save```\n  + ```import Picker from 'vanilla-picker';```\n\n* For the rest of us:\n\n```\n<script src=\"https://unpkg.com/vanilla-picker@2\"></script>\n```\n\n> **_Note:_**\n> \n> The script adds a `<style>` element to the page, with all the needed CSS. If your site's [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) doesn't allow that, use the CSP build with a separate CSS file instead:\n> ```\n> import Picker from 'vanilla-picker/csp';\n> import 'vanilla-picker/dist/vanilla-picker.csp.css';\n> ```\n> ..or\n> ```\n> <script src=\"vanilla-picker.csp.min.js\"></script>\n> <link  href=\"vanilla-picker.csp.css\" rel=\"stylesheet\">\n> ```\n\n#### Usage\n\n```html\n<div id=\"parent\">Click me</div>\n\n<script>\n\n    /*\n        Create a new Picker instance and set the parent element.\n        By default, the color picker is a popup which appears when you click the parent.\n    */\n    var parent = document.querySelector('#parent');\n    var picker = new Picker(parent);\n\n    /*\n        You can do what you want with the chosen color using two callbacks: onChange and onDone.\n    */\n    picker.onChange = function(color) {\n        parent.style.background = color.rgbaString;\n    };\n\n    /* onDone is similar to onChange, but only called when you click 'Ok' */\n\n</script>\n```\n\n\n## API and advanced options\n\nhttps://vanilla-picker.js.org/gen/Picker.html\n\n\n## Accessibility\n\nThe color picker is built to support basic keyboard navigation and use with screen readers.\nI would be very interested in feedback on improvements that could be done here!\n\n\n## Credits\n\n* Based on https://github.com/dissimulate/Picker by **Adam Brooks**\n* Built with https://github.com/Joudee/color-conversion by **Joudee**\n* Built with https://gist.github.com/mjackson/5311256 by **Michael Jackson**\n\n\n## License\n\nThe ISC license - see the [LICENSE.md](LICENSE.md) file for details.\n","publish_time":1522930698452,"_cnpm_publish_time":1522930698452,"dist-tags":{"latest":"2.12.3"}}