{"_id":"color-id","_rev":"10-d98bb5f2d6e10bb53ed3c4eb8a974b93","name":"color-id","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"color-id","version":"1.0.0","keywords":["color"],"author":{"name":"Dima Yv","email":"dfcreative@gmail.com"},"license":"MIT","_id":"color-id@1.0.0","maintainers":[{"name":"dfcreative","email":"df.creative@gmail.com"}],"homepage":"https://github.com/dfcreative/color-id#readme","bugs":{"url":"https://github.com/dfcreative/color-id/issues"},"dist":{"shasum":"8d1b64234876cb1d5ab38b0deff76aea689b617d","tarball":"https://registry.npmjs.org/color-id/-/color-id-1.0.0.tgz","integrity":"sha512-2pdOnoBd1j7Yb6YeN6mNXE9Rn4eZt9+jggvsj+ELV5ZyXQ02y8vl4lA32XEcJbDi00HIWKHyTZuEnJKpgGo6Sw==","signatures":[{"sig":"MEYCIQDOHta9ld3h0hHE0mXnTdBqotE/DTbm7bsoRWFOYJYpVgIhAP7bBT3UTn9j5w9y1s0rT9xKOwcSmG1STv0xtkVVcwgd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"8d1b64234876cb1d5ab38b0deff76aea689b617d","gitHead":"80e60ed4d8c16f4282737886c894d77a7afdf578","scripts":{"test":"node test"},"_npmUser":{"name":"dfcreative","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/dfcreative/color-id.git","type":"git"},"_npmVersion":"3.7.2","description":"Get integer id for a color","directories":{},"_nodeVersion":"6.2.0","dependencies":{"clamp":"^1.0.1"},"_npmOperationalInternal":{"tmp":"tmp/color-id-1.0.0.tgz_1486559369960_0.19569429708644748","host":"packages-12-west.internal.npmjs.com"}},"1.0.1":{"name":"color-id","version":"1.0.1","keywords":["color"],"author":{"name":"Dima Yv","email":"dfcreative@gmail.com"},"license":"MIT","_id":"color-id@1.0.1","maintainers":[{"name":"dfcreative","email":"df.creative@gmail.com"}],"homepage":"https://github.com/dfcreative/color-id#readme","bugs":{"url":"https://github.com/dfcreative/color-id/issues"},"dist":{"shasum":"7388e458dce1ba73b08932876d8ce2a71c981976","tarball":"https://registry.npmjs.org/color-id/-/color-id-1.0.1.tgz","integrity":"sha512-QajxzTDBKS7WIW3AbWGAG+tsuCi7bd382pOc6w6ebHCBCRrbCYydSMJ0b5mIvuTyFwfibBwqanJtxDE2cnH/Bw==","signatures":[{"sig":"MEUCIQCXyVnMyigW4jrKiHIk8/xF+wbD91awMb9GVblNKLljDwIgUIPRPkSnUVxhjEcvhNsOhw7xCDngPRkyMC9f/A8TwXU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"7388e458dce1ba73b08932876d8ce2a71c981976","gitHead":"6ec9a4a3600087abd15e16e483783e193a1de8c1","scripts":{"test":"node test"},"_npmUser":{"name":"dfcreative","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/dfcreative/color-id.git","type":"git"},"_npmVersion":"3.7.2","description":"Get integer id for a color","directories":{},"_nodeVersion":"6.2.0","dependencies":{"clamp":"^1.0.1"},"_npmOperationalInternal":{"tmp":"tmp/color-id-1.0.1.tgz_1486559613410_0.05580890458077192","host":"packages-18-east.internal.npmjs.com"}},"1.0.2":{"name":"color-id","version":"1.0.2","keywords":["color"],"author":{"name":"Dima Yv","email":"dfcreative@gmail.com"},"license":"MIT","_id":"color-id@1.0.2","maintainers":[{"name":"dfcreative","email":"df.creative@gmail.com"}],"homepage":"https://github.com/dfcreative/color-id#readme","bugs":{"url":"https://github.com/dfcreative/color-id/issues"},"dist":{"shasum":"281ee4047fcf207b635b5ee6ed41a428881908e4","tarball":"https://registry.npmjs.org/color-id/-/color-id-1.0.2.tgz","integrity":"sha512-k3VJwsvureMnf+QqvQVIshYZkSokCKmgOIb1R32yGU5aou3toPG3fVHgvqVbpatVHwJhRUxp8k/pUcqzRTFcFQ==","signatures":[{"sig":"MEYCIQCK5DjI10LD34pXKBon3VnUQtRy6bB0qwR0VQ07ecC/WgIhAMygd6pX86ikzCBuImNJaAlp8xmVp11molhuap+ikxM4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"281ee4047fcf207b635b5ee6ed41a428881908e4","gitHead":"9ab5cda16cd8fd42552545fccdf54628cdfdbfb5","scripts":{"test":"node test"},"_npmUser":{"name":"dfcreative","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/dfcreative/color-id.git","type":"git"},"_npmVersion":"3.7.2","description":"Get integer id for a color","directories":{},"_nodeVersion":"6.2.0","dependencies":{"clamp":"^1.0.1"},"_npmOperationalInternal":{"tmp":"tmp/color-id-1.0.2.tgz_1486839061826_0.4721676013432443","host":"packages-18-east.internal.npmjs.com"}},"1.0.3":{"name":"color-id","version":"1.0.3","keywords":["color"],"author":{"name":"Dima Yv","email":"dfcreative@gmail.com"},"license":"MIT","_id":"color-id@1.0.3","maintainers":[{"name":"dfcreative","email":"df.creative@gmail.com"}],"homepage":"https://github.com/dfcreative/color-id#readme","bugs":{"url":"https://github.com/dfcreative/color-id/issues"},"dist":{"shasum":"f681e64010f4fd466009b99a295e248e400c1187","tarball":"https://registry.npmjs.org/color-id/-/color-id-1.0.3.tgz","integrity":"sha512-Ud+4klDS1L3iGUhcQWYLDt0mgvUbBJtkasVkBCenXiyOlvj+bqfGLy4Kds8uvRaZNCjF1AHl+Mz6ac66LJOP6w==","signatures":[{"sig":"MEUCIEQAg06KEzWnofgGpqIsko85thQFEJpr1xJxtG/VFkuvAiEArDUAPFYeLd9Rt3YEyp9JS+Tzm2dDd6SpmBxhaHoafao=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"f681e64010f4fd466009b99a295e248e400c1187","gitHead":"8a8ba87d1891e81bad665ddb298a405d5290747e","scripts":{"test":"node test"},"_npmUser":{"name":"dfcreative","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/dfcreative/color-id.git","type":"git"},"_npmVersion":"3.7.2","description":"Get integer id for a color","directories":{},"_nodeVersion":"6.2.0","dependencies":{"clamp":"^1.0.1"},"_npmOperationalInternal":{"tmp":"tmp/color-id-1.0.3.tgz_1487151051473_0.4352906986605376","host":"packages-18-east.internal.npmjs.com"}},"1.1.0":{"name":"color-id","version":"1.1.0","keywords":["color","colorjs"],"author":{"name":"Dima Yv","email":"dfcreative@gmail.com"},"license":"MIT","_id":"color-id@1.1.0","maintainers":[{"name":"dfcreative","email":"df.creative@gmail.com"}],"homepage":"https://github.com/colorjs/color-id#readme","bugs":{"url":"https://github.com/colorjs/color-id/issues"},"dist":{"shasum":"5e9159b99a73ac98f74820cb98a15fde3d7e034c","tarball":"https://registry.npmjs.org/color-id/-/color-id-1.1.0.tgz","integrity":"sha512-2iRtAn6dC/6/G7bBIo0uupVrIne1NsQJvJxZOBCzQOfk7jRq97feaDZ3RdzuHakRXXnHGNwglto3pqtRx1sX0g==","signatures":[{"sig":"MEQCIAp4I7kM76nLPPSKCeC/tAeY//A4VvW8BDCLeiTUTLaGAiBUWd2m1/xbHW0wH/YBgTuhiXT7/R8kRbxS/C4Kfu0U/Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","gitHead":"f9b11dde281e250bad85d8bd26a7a722551f240d","scripts":{"test":"node test"},"_npmUser":{"name":"dfcreative","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/colorjs/color-id.git","type":"git"},"_npmVersion":"5.0.2","description":"Get integer id for a color","directories":{},"_nodeVersion":"6.2.0","dependencies":{"clamp":"^1.0.1"},"_npmOperationalInternal":{"tmp":"tmp/color-id-1.1.0.tgz_1496698561937_0.42981479968875647","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"color-id","version":"2.0.0","description":"Pack RGBA color channels into uint32 and back","type":"module","exports":"./index.js","types":"./index.d.ts","scripts":{"test":"node --test test.js"},"repository":{"type":"git","url":"git+https://github.com/colorjs/color-id.git"},"keywords":["color","rgba","pack","uint32","colorjs"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/colorjs/color-id/issues"},"homepage":"https://github.com/colorjs/color-id#readme","gitHead":"3351510d032d5a24b1d5d6c0bfd865176dafb592","_id":"color-id@2.0.0","_nodeVersion":"25.8.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-zxI2YgTLrMFp4SITppq4TJyOuWpMjKICWPu/60JY+MLeHmBw1NUb4wFmTIHuA4gWwSWPjc1xBdTApxqVmPj5Qg==","shasum":"de81298858e28bd31ee76e42937d44b262faac6d","tarball":"https://registry.npmjs.org/color-id/-/color-id-2.0.0.tgz","fileCount":5,"unpackedSize":3728,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAPfhyb8qXnEMVMsJoI+zUSAcOySXI/QBWQOBdWmr3RuAiBgqD2hLicn9GnQQa3fdfuh+IyQ6zA0/BfVn13lvvf2Tw=="}]},"_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"directories":{},"maintainers":[{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/color-id_2.0.0_1774576235455_0.29392842103816386"},"_hasShrinkwrap":false}},"time":{"created":"2017-02-08T13:09:31.887Z","modified":"2026-03-27T01:50:35.722Z","1.0.0":"2017-02-08T13:09:31.887Z","1.0.1":"2017-02-08T13:13:34.061Z","1.0.2":"2017-02-11T18:51:02.456Z","1.0.3":"2017-02-15T09:30:52.052Z","1.1.0":"2017-06-05T21:36:02.822Z","2.0.0":"2026-03-27T01:50:35.608Z"},"bugs":{"url":"https://github.com/colorjs/color-id/issues"},"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","homepage":"https://github.com/colorjs/color-id#readme","keywords":["color","rgba","pack","uint32","colorjs"],"repository":{"type":"git","url":"git+https://github.com/colorjs/color-id.git"},"description":"Pack RGBA color channels into uint32 and back","maintainers":[{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"readme":"# color-id\n\nPack RGBA color channels into a single uint32 integer and back.\n\n## Install\n\n```\nnpm install color-id\n```\n\n## Usage\n\n```js\nimport colorId, { from } from 'color-id'\n\n// normalized 0..1 (default)\ncolorId([1, 0, 0, 1])     // 0xff0000ff\nfrom(0xff0000ff)           // [1, 0, 0, 1]\n\n// byte values 0..255\ncolorId([255, 0, 0, 255], false)  // 0xff0000ff\nfrom(0xff0000ff, false)           // [255, 0, 0, 255]\n```\n\n## API\n\n### `coloId(rgba, normalized=true)` / default export\n\nPack `[r, g, b, a?]` channels into a uint32. Values are clamped to valid range. Alpha defaults to `1` (normalized) or `255` (byte).\n\n### `from(n, normalized=true)`\n\nUnpack uint32 into `[r, g, b, a]` channels.\n\n**`normalized`** — `true` for 0..1 range, `false` for 0..255 byte values.\n\n## Related\n\n- [color-rgba](https://github.com/colorjs/color-rgba) — parse color string to rgba array\n- [color-alpha](https://github.com/colorjs/color-alpha) — change alpha channel for a color\n- [color-interpolate](https://github.com/colorjs/color-interpolate) — interpolate over palette or gradient\n\n## License\n\nMIT\n","readmeFilename":"readme.md"}