hex2rgb-plus
The script allows you to convert hex color to rgb
Install
npm i hex2rgb-plus --save
Usage
from hex to rgb
import hex2rgb from "hex2rgb-plus"
let rgb_type_1 = hex2rgb.rgb2hex(0, 130, 195) // => '#0082c3'
let rgb_type_2 = hex2rgb.rgb2hex("rgba(0, 130, 195,1)") // => '#0082c3'
from rgb to hex
import hex2rgb from "hex2rgb-plus"
let rgb = hex2rgb.hex2rgb("#0082c3") // => {r: 0, g: 130, b: 195, rgba: 'rgba(0,130,195,1)'}