{"_id":"rgb-hex","_rev":"4081112","name":"rgb-hex","description":"Convert RGB(A) color to HEX","dist-tags":{"latest":"4.1.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2025-10-28T01:30:10.000Z","created":"2014-07-27T13:34:41.343Z","4.1.0":"2023-09-01T07:46:16.100Z","4.0.1":"2023-03-14T09:14:59.584Z","4.0.0":"2021-05-03T12:13:09.831Z","3.0.0":"2019-04-26T06:52:33.008Z","2.1.0":"2016-11-04T04:26:24.529Z","2.0.0":"2016-08-14T18:45:37.527Z","1.0.0":"2014-07-27T13:34:41.343Z"},"users":{"arnoldstoba":true,"seangenabe":true,"rocket0191":true,"gamersdelight":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/rgb-hex.git"},"versions":{"4.1.0":{"name":"rgb-hex","version":"4.1.0","description":"Convert RGB(A) color to HEX","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/rgb-hex.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava","//test":"xo && ava && tsd"},"keywords":["rgb","hex","color","colour","convert","conversion","converter"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.39.1"},"types":"./index.d.ts","gitHead":"49e46afac871cf2adde9b27bce4a6958deffffbd","bugs":{"url":"https://github.com/sindresorhus/rgb-hex/issues"},"homepage":"https://github.com/sindresorhus/rgb-hex#readme","_id":"rgb-hex@4.1.0","_nodeVersion":"18.16.1","_npmVersion":"9.2.0","dist":{"shasum":"b343f394c8f9df629a7504c34c00b5bc63bd006f","size":2273,"noattachment":false,"key":"/rgb-hex/-/rgb-hex-4.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rgb-hex/download/rgb-hex-4.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rgb-hex_4.1.0_1693554375935_0.5374664372926783"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-09-01T07:46:16.100Z","publish_time":1693554376100,"_source_registry_name":"default","_cnpm_publish_time":1693554376100},"4.0.1":{"name":"rgb-hex","version":"4.0.1","description":"Convert RGB(A) color to HEX","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/rgb-hex.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava","//test":"xo && ava && tsd"},"keywords":["rgb","hex","color","colour","convert","conversion","converter"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.39.1"},"types":"./index.d.ts","gitHead":"214528a70d9b838f16b009e7e9f4c90fb9d1c40c","bugs":{"url":"https://github.com/sindresorhus/rgb-hex/issues"},"homepage":"https://github.com/sindresorhus/rgb-hex#readme","_id":"rgb-hex@4.0.1","_nodeVersion":"18.14.2","_npmVersion":"9.2.0","dist":{"shasum":"02649ee989fef1234757efd0d2b5a73a0c9a31e1","size":1976,"noattachment":false,"key":"/rgb-hex/-/rgb-hex-4.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/rgb-hex/download/rgb-hex-4.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rgb-hex_4.0.1_1678785299401_0.06989082718270723"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-03-14T09:14:59.584Z","publish_time":1678785299584,"_cnpm_publish_time":1678785299584},"4.0.0":{"name":"rgb-hex","version":"4.0.0","description":"Convert RGB(A) color to HEX","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/rgb-hex.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["rgb","hex","color","colour","convert","conversion","converter"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.39.1"},"gitHead":"b3e9b9115e17329c7f084094731cb2f8ac5e3e00","bugs":{"url":"https://github.com/sindresorhus/rgb-hex/issues"},"homepage":"https://github.com/sindresorhus/rgb-hex#readme","_id":"rgb-hex@4.0.0","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"shasum":"02fb1e215e3fe5d070501579a3d2e4fa3c0acec8","size":1971,"noattachment":false,"key":"/rgb-hex/-/rgb-hex-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rgb-hex/download/rgb-hex-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rgb-hex_4.0.0_1620043989726_0.5082289954604815"},"_hasShrinkwrap":false,"publish_time":1620043989831,"_cnpm_publish_time":1620043989831},"3.0.0":{"name":"rgb-hex","version":"3.0.0","description":"Convert RGB(A) color to HEX","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/rgb-hex.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["rgb","hex","color","colour","convert","conversion","converter"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"bfecfeafede942bcf20763a8d7638c27c968d36a","bugs":{"url":"https://github.com/sindresorhus/rgb-hex/issues"},"homepage":"https://github.com/sindresorhus/rgb-hex#readme","_id":"rgb-hex@3.0.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"eab0168cc1279563b18a14605315389142e2e487","size":1996,"noattachment":false,"key":"/rgb-hex/-/rgb-hex-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rgb-hex/download/rgb-hex-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rgb-hex_3.0.0_1556261552849_0.7348703900980134"},"_hasShrinkwrap":false,"publish_time":1556261553008,"_cnpm_publish_time":1556261553008},"2.1.0":{"name":"rgb-hex","version":"2.1.0","description":"Convert RGB(A) color to HEX","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/rgb-hex.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["rgb","hex","color","colour","convert","conversion","converter"],"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"1982e8432c26b16e04de9abbea7beba66533a77e","bugs":{"url":"https://github.com/sindresorhus/rgb-hex/issues"},"homepage":"https://github.com/sindresorhus/rgb-hex#readme","_id":"rgb-hex@2.1.0","_shasum":"c773c5fe2268a25578d92539a82a7a5ce53beda6","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.6.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"c773c5fe2268a25578d92539a82a7a5ce53beda6","size":1962,"noattachment":false,"key":"/rgb-hex/-/rgb-hex-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rgb-hex/download/rgb-hex-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/rgb-hex-2.1.0.tgz_1478233582629_0.0022867806255817413"},"directories":{},"publish_time":1478233584529,"_cnpm_publish_time":1478233584529,"_hasShrinkwrap":false},"2.0.0":{"name":"rgb-hex","version":"2.0.0","description":"Convert RGB color to HEX","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/rgb-hex.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["rgb","hex","color","colour","convert","conversion","converter"],"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"19cb8cfd7b354808088d66f752d10f8ec6c8fa43","bugs":{"url":"https://github.com/sindresorhus/rgb-hex/issues"},"homepage":"https://github.com/sindresorhus/rgb-hex#readme","_id":"rgb-hex@2.0.0","_shasum":"a4e49881b031594e72a4b564416fe93ae1a87870","_from":".","_npmVersion":"2.15.5","_nodeVersion":"4.4.5","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"a4e49881b031594e72a4b564416fe93ae1a87870","size":1723,"noattachment":false,"key":"/rgb-hex/-/rgb-hex-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rgb-hex/download/rgb-hex-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/rgb-hex-2.0.0.tgz_1471200335976_0.024921796517446637"},"directories":{},"publish_time":1471200337527,"_cnpm_publish_time":1471200337527,"_hasShrinkwrap":false},"1.0.0":{"name":"rgb-hex","version":"1.0.0","description":"Convert RGB color to HEX","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/rgb-hex"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["rgb","hex","color","colour","convert","conversion","converter"],"devDependencies":{"ava":"0.0.3"},"gitHead":"d767c0b4fddbff2fa1b99ef14da4d2c83793bcd0","bugs":{"url":"https://github.com/sindresorhus/rgb-hex/issues"},"homepage":"https://github.com/sindresorhus/rgb-hex","_id":"rgb-hex@1.0.0","_shasum":"bfaf8cd9cd9164b5a26d71eb4f15a0965324b3c1","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"bfaf8cd9cd9164b5a26d71eb4f15a0965324b3c1","size":866,"noattachment":false,"key":"/rgb-hex/-/rgb-hex-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rgb-hex/download/rgb-hex-1.0.0.tgz"},"directories":{},"publish_time":1406468081343,"_cnpm_publish_time":1406468081343,"_hasShrinkwrap":false}},"readme":"# rgb-hex\n\n> Convert RGB(A) color to HEX\n\n## Install\n\n```\n$ npm install rgb-hex\n```\n\n## Usage\n\n```js\nimport rgbHex from 'rgb-hex';\n\nrgbHex(65, 131, 196);\n//=> '4183c4'\n\nrgbHex('rgb(40, 42, 54)');\n//=> '282a36'\n\nrgbHex(65, 131, 196, 0.2);\n//=> '4183c433'\n\nrgbHex(40, 42, 54, '75%');\n//=> '282a36bf'\n\nrgbHex('rgba(40, 42, 54, 75%)');\n//=> '282a36bf'\n```\n\n## Related\n\n- [rgb-hex-cli](https://github.com/sindresorhus/rgb-hex-cli) - CLI for this module\n- [hex-rgb](https://github.com/sindresorhus/hex-rgb) - Convert HEX color to RGB\n","_attachments":{},"homepage":"https://github.com/sindresorhus/rgb-hex#readme","bugs":{"url":"https://github.com/sindresorhus/rgb-hex/issues"},"license":"MIT"}