{"name":"color-string","description":"Parser and generator for CSS color strings","version":"1.7.4","author":{"name":"Heather Arthur","email":"fayearthur@gmail.com"},"contributors":[{"name":"Maxime Thirouin"},{"name":"Dyma Ywanov","email":"dfcreative@gmail.com"},{"name":"Josh Junon"}],"repository":{"type":"git","url":"git+https://github.com/Qix-/color-string.git"},"scripts":{"pretest":"xo","test":"node test/basic.js"},"license":"MIT","xo":{"rules":{"no-cond-assign":0,"operator-linebreak":0}},"dependencies":{"color-name":"^1.0.0","simple-swizzle":"^0.2.2"},"devDependencies":{"xo":"^0.12.1"},"keywords":["color","colour","rgb","css"],"gitHead":"b541d55cc678fd9ac9574f8faec791ee7bf2cf05","bugs":{"url":"https://github.com/Qix-/color-string/issues"},"homepage":"https://github.com/Qix-/color-string#readme","_id":"color-string@1.7.4","_nodeVersion":"16.0.0","_npmVersion":"7.23.0","dist":{"integrity":"sha512-nVdUvPVgZMpRQad5dcsCMOSB5BXLljklTiaxS6ehhKxDsAI5sD7k5VmFuBt1y3Rlym8uulc/ANUN/bMWtBu6Sg==","shasum":"79a7bf242610a8aa1b5e2681f3bf6bcfa666245f","tarball":"http://registry-npm.ywwl.com/color-string/download/color-string-1.7.4.tgz","fileCount":4,"unpackedSize":9980,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoJQWCRA9TVsSAnZWagAAONUP/1Dv0ujbZr+rwTiGDq8c\nMWb1E7Rma8b4mY78bfGjKN0m54zFBybrS5vgoWKrVJNFr3UDCxgcKapCuHm3\n6P4URoL02dc6tYMWwo8vWQUjxA3wgm2cs7czd7rQVtnHgjoOLRzwnREFoAzU\nXiMQ1AMiIWsbECii6w43Qtnb/5qJtaWdNedFHHOTKMHggQxG41NzAKT+8kYu\nvcoNEdNxGgAnE83Lq9utZt+7pM5I6P1HSLvscF7x2+XUn5EeRhOm1aLAuTB2\nl9JRES7oskIc9/upapu1F02l6uZ3IHBdIiKFuf+WJDb8pnECSD9TUVUnQhA9\npNXHbOtJUpRFgWhkDNo6LRtOBfjzr+3E79I/mA19V0XLOn+G1e+57M4b/VhT\nui0/giYiU0l3p0C48vps/VIPwEPz4+EaGtqRTauNyCxiGbJCojVlfN6OhJpC\nwJdSeW0VqOtOhL2eJBF1cA+qTD1P05DERvUKAczaJNpI8O1rtjZtNGAShrFu\neEPdDuqrDpKcgbaWrds1UsTxIcXjkWElaXShPq9U9EVsfxG4H2LX3JdlimOD\nOreeIaH70jii9mZJ9Cc8VEOqVCVdJEYNHi3NIrPj/dm909xZCV+DJDkFRwXG\nV+vZJYWra8axeza16/Ly6teqWY+s/IaqJFPVsfMwHglFa3FZc8LDsLrZpDis\n7cjw\r\n=Rvyk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAT4riUbm6dzI/T7wggGXcQ5hdDmCntpgoWWGptlWzQFAiBLIiYLuxYwGxLSU2Fk/k8EHjAHT/wPeK+CdmwEXU0tow=="}],"size":3343,"noattachment":false,"key":"/color-string/-/color-string-1.7.4.tgz"},"_npmUser":{"name":"qix","email":"josh@junon.me"},"directories":{},"maintainers":[{"name":"qix","email":"josh@junon.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/color-string_1.7.4_1637913622326_0.8098232157567156"},"_hasShrinkwrap":false,"readme":"# color-string\n\n> library for parsing and generating CSS color strings.\n\n## Install\n\nWith [npm](http://npmjs.org/):\n\n```console\n$ npm install color-string\n```\n\n## Usage\n\n### Parsing\n\n```js\ncolorString.get('#FFF')                          // {model: 'rgb', value: [255, 255, 255, 1]}\ncolorString.get('#FFFA')                         // {model: 'rgb', value: [255, 255, 255, 0.67]}\ncolorString.get('#FFFFFFAA')                     // {model: 'rgb', value: [255, 255, 255, 0.67]}\ncolorString.get('hsl(360, 100%, 50%)')           // {model: 'hsl', value: [0, 100, 50, 1]}\ncolorString.get('hsl(360 100% 50%)')             // {model: 'hsl', value: [0, 100, 50, 1]}\ncolorString.get('hwb(60, 3%, 60%)')              // {model: 'hwb', value: [60, 3, 60, 1]}\n\ncolorString.get.rgb('#FFF')                      // [255, 255, 255, 1]\ncolorString.get.rgb('blue')                      // [0, 0, 255, 1]\ncolorString.get.rgb('rgba(200, 60, 60, 0.3)')    // [200, 60, 60, 0.3]\ncolorString.get.rgb('rgba(200 60 60 / 0.3)')     // [200, 60, 60, 0.3]\ncolorString.get.rgb('rgba(200 60 60 / 30%)')     // [200, 60, 60, 0.3]\ncolorString.get.rgb('rgb(200, 200, 200)')        // [200, 200, 200, 1]\ncolorString.get.rgb('rgb(200 200 200)')          // [200, 200, 200, 1]\n\ncolorString.get.hsl('hsl(360, 100%, 50%)')       // [0, 100, 50, 1]\ncolorString.get.hsl('hsl(360 100% 50%)')         // [0, 100, 50, 1]\ncolorString.get.hsl('hsla(360, 60%, 50%, 0.4)')  // [0, 60, 50, 0.4]\ncolorString.get.hsl('hsl(360 60% 50% / 0.4)')    // [0, 60, 50, 0.4]\n\ncolorString.get.hwb('hwb(60, 3%, 60%)')          // [60, 3, 60, 1]\ncolorString.get.hwb('hwb(60, 3%, 60%, 0.6)')     // [60, 3, 60, 0.6]\n\ncolorString.get.rgb('invalid color string')      // null\n```\n\n### Generation\n\n```js\ncolorString.to.hex([255, 255, 255])     // \"#FFFFFF\"\ncolorString.to.hex([0, 0, 255, 0.4])    // \"#0000FF66\"\ncolorString.to.hex([0, 0, 255], 0.4)    // \"#0000FF66\"\ncolorString.to.rgb([255, 255, 255])     // \"rgb(255, 255, 255)\"\ncolorString.to.rgb([0, 0, 255, 0.4])    // \"rgba(0, 0, 255, 0.4)\"\ncolorString.to.rgb([0, 0, 255], 0.4)    // \"rgba(0, 0, 255, 0.4)\"\ncolorString.to.rgb.percent([0, 0, 255]) // \"rgb(0%, 0%, 100%)\"\ncolorString.to.keyword([255, 255, 0])   // \"yellow\"\ncolorString.to.hsl([360, 100, 100])     // \"hsl(360, 100%, 100%)\"\ncolorString.to.hwb([50, 3, 15])         // \"hwb(50, 3%, 15%)\"\n\n// all functions also support swizzling\ncolorString.to.rgb(0, [0, 255], 0.4)    // \"rgba(0, 0, 255, 0.4)\"\ncolorString.to.rgb([0, 0], [255], 0.4)  // \"rgba(0, 0, 255, 0.4)\"\ncolorString.to.rgb([0], 0, [255, 0.4])  // \"rgba(0, 0, 255, 0.4)\"\n```\n","publish_time":1637913622531,"_cnpm_publish_time":1637913622531,"dist-tags":{"latest":"2.1.4"}}