@cjser/rgb-hex
v4.1.0-cjser.2
Published
Convert RGB(A) color to HEX
Downloads
76
Maintainers
Readme
rgb-hex
Convert RGB(A) color to HEX
Install
$ npm install rgb-hexUsage
import rgbHex from 'rgb-hex';
rgbHex(65, 131, 196);
//=> '4183c4'
rgbHex('rgb(40, 42, 54)');
//=> '282a36'
rgbHex(65, 131, 196, 0.2);
//=> '4183c433'
rgbHex(40, 42, 54, '75%');
//=> '282a36bf'
rgbHex('rgba(40, 42, 54, 75%)');
//=> '282a36bf'Related
- rgb-hex-cli - CLI for this module
- hex-rgb - Convert HEX color to RGB
cjser
This package is a CommonJS-compatible build generated by cjser for projects that still need require() support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.
Original repository: https://github.com/sindresorhus/rgb-hex
