rgbx2hex
rgba2hex, rgb2hex
Install
$ npm i -D rgbx2hex
Usage
import rgbx2hex from 'rgbx2hex'
let hex_1 = rgbx2hex('rgba(238,153,34,0.502)') // output: '#80EE9922'
let hex_2 = rgbx2hex('rgb(255,100,97)') // output: '#FF6461'
rgba2hex, rgb2hex
$ npm i -D rgbx2hex
import rgbx2hex from 'rgbx2hex'
let hex_1 = rgbx2hex('rgba(238,153,34,0.502)') // output: '#80EE9922'
let hex_2 = rgbx2hex('rgb(255,100,97)') // output: '#FF6461'
npm i rgbx2hex
4
1.0.0
MIT
3.13 kB
5