Convert rgb color to hex and hex to rgb
$ npm install @isabellymonteiro/rgb-hex
import { rgbToHex } from '@isabellymonteiro/rgb-hex'
rgbToHex(0, 76, 153)
// '#004c99'
It does not work for a shorthand hex triplet such as '#03F'.
import { hexToRgb } from '@isabellymonteiro/rgb-hex'
hexToRgb('004c99') // or hexToRgb('#004c99')
// { r: 0, g: 76, b: 153 }