{"_id":"get-contrast","_rev":"13-1e4ddd341b800076ea105802ec3dcbea","name":"get-contrast","description":"Get the contrast ratio and WCAG score between common CSS color types.","dist-tags":{"latest":"3.0.0"},"versions":{"0.0.1":{"name":"get-contrast","version":"0.0.1","description":"Get the contrast ratio and WCAG score between common CSS color types.","main":"index.js","directories":{"test":"test"},"scripts":{"test":"mocha test"},"repository":{"type":"git","url":"https://github.com/johnotander/get-contrast.git"},"keywords":["wcag","color","contrast","contrast-ratio"],"author":{"name":"John Otander","email":"johnotander@gmail.com","url":"http://johnotander.com/"},"license":"MIT","bugs":{"url":"https://github.com/johnotander/get-contrast/issues"},"homepage":"https://github.com/johnotander/get-contrast","dependencies":{"is-blank":"0.0.1","rgb":"^0.1.0","wcag-contrast":"0.0.0"},"devDependencies":{"mocha":"^2.0.1"},"gitHead":"f3e849a90cf10cd0e8976d2551f115dd088fcc81","_id":"get-contrast@0.0.1","_shasum":"d52d37fa4038f8141e21010faa958b2657cee054","_from":".","_npmVersion":"2.1.9","_nodeVersion":"0.10.33","_npmUser":{"name":"johno","email":"johnotander@gmail.com"},"maintainers":[{"name":"johno","email":"johnotander@gmail.com"}],"dist":{"shasum":"d52d37fa4038f8141e21010faa958b2657cee054","tarball":"https://registry.npmjs.org/get-contrast/-/get-contrast-0.0.1.tgz","integrity":"sha512-R63iZTWErdVkzE4UCw84ZBGwXJbyHkeMHjyCiqTuqmkSNp8MrV8V52Y1xKX7Br1wHnzX7I2Zn7I7J8Sku+Lo9g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZp4npQnTx6dXYzbSoXnBb7wBC01yS3GvdU+OyEIeOJwIgFZeXqIWMei2yPASB95SkDiROA0/TI9x/B753GZX2P2k="}]}},"1.0.0":{"name":"get-contrast","version":"1.0.0","description":"Get the contrast ratio and WCAG score between common CSS color types.","main":"index.js","directories":{"test":"test"},"bin":{"contrast":"./cli.js"},"scripts":{"test":"mocha test"},"repository":{"type":"git","url":"https://github.com/johnotander/get-contrast.git"},"keywords":["wcag","color","contrast","contrast-ratio"],"author":{"name":"John Otander","email":"johnotander@gmail.com","url":"http://johnotander.com/"},"license":"MIT","bugs":{"url":"https://github.com/johnotander/get-contrast/issues"},"homepage":"https://github.com/johnotander/get-contrast","dependencies":{"is-blank":"0.0.1","rgb":"^0.1.0","wcag-contrast":"0.0.0"},"devDependencies":{"mocha":"^2.0.1"},"gitHead":"007faf46a76f6b92d41508a1c35447f03473a81d","_id":"get-contrast@1.0.0","_shasum":"f6ec0ce8aab3675d56a19c9d0fb712fc8e9c2182","_from":".","_npmVersion":"2.5.0","_nodeVersion":"0.10.35","_npmUser":{"name":"johno","email":"johnotander@gmail.com"},"maintainers":[{"name":"johno","email":"johnotander@gmail.com"}],"dist":{"shasum":"f6ec0ce8aab3675d56a19c9d0fb712fc8e9c2182","tarball":"https://registry.npmjs.org/get-contrast/-/get-contrast-1.0.0.tgz","integrity":"sha512-PrXpT9pVHbKClM4Ct7OhTocU1JYI0rAcKiSCe3eryktJPWE+th9Sqq9XetWx5Y8CIRtejseTjMQ4FVlvObIVKQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEwpMQh0V3j8Ykw4uDBxMX882BvpIj2lCE6dftRq7FZuAiEA9ffdDl1a5DktUIYJL/GfFxC2m37jQzJKZ7Si+Rvqpng="}]}},"1.1.0":{"name":"get-contrast","version":"1.1.0","description":"Get the contrast ratio and WCAG score between common CSS color types.","main":"index.js","directories":{"test":"test"},"bin":{"contrast":"./cli.js"},"scripts":{"test":"mocha test"},"repository":{"type":"git","url":"https://github.com/johnotander/get-contrast.git"},"keywords":["wcag","color","contrast","contrast-ratio"],"author":{"name":"John Otander","email":"johnotander@gmail.com","url":"http://johnotander.com/"},"license":"MIT","bugs":{"url":"https://github.com/johnotander/get-contrast/issues"},"homepage":"https://github.com/johnotander/get-contrast","dependencies":{"css-color-names":"0.0.1","is-blank":"0.0.1","is-named-css-color":"0.0.1","rgb":"^0.1.0","wcag-contrast":"0.0.0"},"devDependencies":{"mocha":"^2.0.1"},"gitHead":"6f5c106395a7b3fbd959217ac8edb58449128f23","_id":"get-contrast@1.1.0","_shasum":"14c38eaf36824deed2559f159411d321dca3b52a","_from":".","_npmVersion":"2.5.0","_nodeVersion":"0.10.35","_npmUser":{"name":"johno","email":"johnotander@gmail.com"},"dist":{"shasum":"14c38eaf36824deed2559f159411d321dca3b52a","tarball":"https://registry.npmjs.org/get-contrast/-/get-contrast-1.1.0.tgz","integrity":"sha512-KzpXb8FMkHO4ziygPSoMGwafaXdrchQmCUTw6UyTRvzaLglYtmNDd2jp8EAYkZeX0ZKi88vx4s85DrrazKmaoA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFTKAe/5B5Taiic9A6VcOXHs409wXWH9HT3B0ilnDVNIAiAwKSWEVljAUgEy+XL4KbMJ3Zx3dF/j8sMLdsZQm8cbFA=="}]},"maintainers":[{"name":"johno","email":"johnotander@gmail.com"}]},"1.1.1":{"name":"get-contrast","version":"1.1.1","description":"Get the contrast ratio and WCAG score between common CSS color types.","main":"index.js","directories":{"test":"test"},"bin":{"contrast":"./cli.js"},"scripts":{"test":"mocha test"},"repository":{"type":"git","url":"https://github.com/johnotander/get-contrast.git"},"keywords":["wcag","color","contrast","contrast-ratio"],"author":{"name":"John Otander","email":"johnotander@gmail.com","url":"http://johnotander.com/"},"license":"MIT","bugs":{"url":"https://github.com/johnotander/get-contrast/issues"},"homepage":"https://github.com/johnotander/get-contrast","dependencies":{"css-color-names":"0.0.1","is-blank":"0.0.1","is-named-css-color":"0.0.1","rgb":"^0.1.0","wcag-contrast":"0.0.0"},"devDependencies":{"mocha":"^2.0.1"},"gitHead":"b6977b85dc55a40d9c53cc208e29300a8a8f2633","_id":"get-contrast@1.1.1","_shasum":"17477157d06a27d8e9d0ad89cc9ef913e07de269","_from":".","_npmVersion":"2.5.0","_nodeVersion":"0.10.35","_npmUser":{"name":"johno","email":"johnotander@gmail.com"},"dist":{"shasum":"17477157d06a27d8e9d0ad89cc9ef913e07de269","tarball":"https://registry.npmjs.org/get-contrast/-/get-contrast-1.1.1.tgz","integrity":"sha512-MuVJbcnuTh0M4/PUpoVEXj6++Ut1nIi7d1Pi5QFRZiitC7qoZA2FBcsKpssfBsus6/4jSzm79kYxaLfGKLHCwQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiyOZTYM3im1EGvNEksP/vV1IW+Ds1KmPMYNM0jSfKoQIgQQyG8A9PRB32PSqTVzQN/GhXKV+v/Ts5Tauwypn/cew="}]},"maintainers":[{"name":"johno","email":"johnotander@gmail.com"}]},"2.0.0":{"name":"get-contrast","version":"2.0.0","description":"Get the contrast ratio and WCAG score between common CSS color types.","main":"index.js","files":["cli.js","index.js"],"directories":{"test":"test"},"bin":{"contrast":"./cli.js"},"scripts":{"test":"ava"},"repository":{"type":"git","url":"git+https://github.com/johnotander/get-contrast.git"},"keywords":["wcag","color","contrast","contrast-ratio"],"author":{"name":"John Otander","email":"johnotander@gmail.com","url":"http://johnotander.com/"},"license":"MIT","dependencies":{"css-color-names":"0.0.3","is-blank":"1.1.0","is-named-css-color":"1.0.0","rgb":"^0.1.0","wcag-contrast":"0.1.0"},"devDependencies":{"ava":"^0.14.0"},"gitHead":"083a48ca313ef0516f8272e3348dca1140a4b183","bugs":{"url":"https://github.com/johnotander/get-contrast/issues"},"homepage":"https://github.com/johnotander/get-contrast#readme","_id":"get-contrast@2.0.0","_shasum":"c965497d258d4c23d03a06595485acc3d51ed6fb","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.9.1","_npmUser":{"name":"johno","email":"johnotander@gmail.com"},"dist":{"shasum":"c965497d258d4c23d03a06595485acc3d51ed6fb","tarball":"https://registry.npmjs.org/get-contrast/-/get-contrast-2.0.0.tgz","integrity":"sha512-7OPD09d+X1fM/HCxTwXsZecMFD1vUHJ2pbXHhvUvnIxOo6CxErrMoxcVAVC6ka0vlujjMyYO75RDLBBW8ZFqNQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCi8ZqCzKQY4dX13/8k0IYrrFtjTWX9+KmmBF+PzFI2RQIhAPNl6AtoOTdmkNdM6tyDKWw7nobrGCfklSczoT+63WPa"}]},"maintainers":[{"name":"johno","email":"johnotander@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/get-contrast-2.0.0.tgz_1462164313859_0.547237167134881"}},"3.0.0":{"name":"get-contrast","version":"3.0.0","description":"Get the contrast ratio and WCAG score between common CSS color types.","main":"index.js","bin":{"contrast":"cli.js"},"scripts":{"test":"ava -v"},"repository":{"type":"git","url":"git+https://github.com/johno/get-contrast.git"},"keywords":["wcag","color","contrast","contrast-ratio"],"author":{"name":"John Otander","email":"johnotander@gmail.com","url":"http://johnotander.com/"},"license":"MIT","dependencies":{"css-color-names":"1.0.1","is-blank":"2.1.0","is-named-css-color":"1.0.0","rgb":"^0.1.0","wcag-contrast":"3.0.0"},"devDependencies":{"ava":"^3.15.0"},"gitHead":"e47fde428e5990c1168d797e8ecdfb32f9b28239","bugs":{"url":"https://github.com/johno/get-contrast/issues"},"homepage":"https://github.com/johno/get-contrast#readme","_id":"get-contrast@3.0.0","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"integrity":"sha512-B3uK3WpKz/4bHMCMSmi4UfZ/Gk8qqVHQXMk6ayhx/x5cCjK3hl5kvX4POTauVQK5kdzWNfbyd5QjwOxERSwKlQ==","shasum":"d7a5f03512f8cf4c5cf51f17ccd87683afe2f6e7","tarball":"https://registry.npmjs.org/get-contrast/-/get-contrast-3.0.0.tgz","fileCount":5,"unpackedSize":5841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJght+tCRA9TVsSAnZWagAAeEkP/3dICXxAYA8aZEMweEtO\nr8/0AuJfssZgPCaGMRPXSQYPBXacHWzzGi8sV0tFH//fpKNcXweLvwWq+U7U\nNI1+7+jpLxxXO/+wUAVaTfaw8ktTDQqW5z3jEivSLJvMa4781j2hgNpZlBmx\nlZEhoetXQMLIEM6Su/g1axB3dxiKnQRd7kk328w2UGNfiq2OD0LRv3z+l8Ez\nqHFTtGJbIP4gCBeEY3wb3V8f45jpbQSKtqlb2Yfj+yveGwkP8ABKaDOZ15gt\nrh2v4Y2tOzhrlgOyeXK+ktnt4WWUxd22XE88/R9I2Y2NAbMq4x7CF7cn27RY\nkh5pNRtHHkhi7A1vOLBOU214mwgaqNWLh6/kNCk+ewcniH7GM8VYftEns6UY\nz/JvbjkuML8N8zEedtQiOX8b4eoUUIWSoV28m3AY1cLkft/dLaMcaE95Z3Sw\nHPz5OF9VPNJ5jAKYXLWiuJjI1LPWzKIcdyxxTJ++fadtWQB79xd4m8iIJ1fu\nXaE9qHJ2Mv8DrwfgZUqapwvwAwCSUMn13BTNn6Xx49U5TmE5pw8YwB1dEnEe\nMMaEtmKt7fZgU43dMiSRILgFpVKkvfE5Bjn0ory0vYRVne/lOTaRPNhKH7my\nlp1SlQNPOPDvfTexojScsQmr0v9yIf+nI1vbNUwdHH/OghtogusvKUauJSoB\nNIR2\r\n=HLOp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDdEXtGdbeh/V4G8j2xxYYxqr6//qpcKCo0PBU9AYDewIhAPO+2bfEKK+bEStdT5aemToiclcGrLq5QkwCESlNBXkS"}]},"_npmUser":{"name":"johno","email":"johnotander@gmail.com"},"directories":{},"maintainers":[{"name":"johno","email":"johnotander@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/get-contrast_3.0.0_1619451821194_0.44515712104289684"},"_hasShrinkwrap":false}},"readme":"# get-contrast\n\nGet the contrast ratio and WCAG score for two colors based on\n[W3C Accessibility Standards](http://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast).\nIt handles rgb, rgba, hex, hsl, hsla, and named CSS colors.\n\n## Installation\n\n```\nnpm i --save get-contrast\n# yarn add get-contrast\n```\n\n## Usage\n\n```javascript\nconst contrast = require(\"get-contrast\");\n\ncontrast.ratio(\"#fafafa\", \"rgba(0,0,0,.75)\"); // => 10\ncontrast.score(\"#fafafa\", \"rgba(0,0,0,.75)\"); // => 'AAA'\ncontrast.isAccessible(\"#fafafa\", \"rgba(0,0,0,.75)\"); // => true\ncontrast.isAccessible(\"#fafafa\", \"#fff\"); // => false\ncontrast.score(\"rebeccapurple\", \"tomato\"); // => 'F'\n```\n\n#### Options\n\n- `ignoreAlpha` (default: `false`) - Don't raise an error when transparent values are passed (`rgba(0, 0, 0, 0)`)\n\n```js\ncontrast.score(\"rgba(0, 0, 0, 0)\", \"rgba(255, 255, 255, 0)\", {\n  ignoreAlpha: true,\n}); // => 'AAA'\n```\n\n## CLI\n\nThis module includes a command line interface `contrast`.\n\n```sh\n$ npm i get-contrast -g\n$ contrast \"#000\" \"#fff\"\nRatio: 21\nScore: AAA\n# The second parameter defaults to #fff\n$ contrast white\nRatio: 1\nScore: F\nThe contrast is not accessible.\n# Contrast will exit with an error code, when the values are not accessible.\n$ contrast \"#ff0\" \"#fff\" && ./deploy.sh\nRatio: 1.0738392309265699\nScore: F\nThe contrast is not accessible.\n```\n\n## Related\n\nUses the following packages:\n\n- <https://github.com/tmcw/wcag-contrast>\n- <https://github.com/kamicane/rgb>\n\nInspired by:\n\n- <https://leaverou.github.com/contrast-ratio>\n\n## License\n\nMIT\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n> Authored by [John Otander](http://johno.com) ([@4lpine](https://twitter.com/4lpine)).\n","maintainers":[{"name":"johno","email":"johnotander@gmail.com"}],"time":{"modified":"2022-06-18T07:46:25.706Z","created":"2014-12-11T05:34:55.584Z","0.0.1":"2014-12-11T05:34:55.584Z","1.0.0":"2015-02-17T21:46:04.869Z","1.1.0":"2015-05-14T16:06:36.809Z","1.1.1":"2015-05-14T16:09:35.758Z","2.0.0":"2016-05-02T04:45:16.203Z","3.0.0":"2021-04-26T15:43:41.310Z"},"homepage":"https://github.com/johno/get-contrast#readme","keywords":["wcag","color","contrast","contrast-ratio"],"repository":{"type":"git","url":"git+https://github.com/johno/get-contrast.git"},"author":{"name":"John Otander","email":"johnotander@gmail.com","url":"http://johnotander.com/"},"bugs":{"url":"https://github.com/johno/get-contrast/issues"},"license":"MIT","readmeFilename":"readme.md","users":{"joshmili":true,"mrbgit":true}}