hex2rgb-plus
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

NPM version Downloads

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)'}

Package Sidebar

Install

npm i hex2rgb-plus

Weekly Downloads

5

Version

1.0.5

License

none

Unpacked Size

3.47 kB

Total Files

5

Last publish

Collaborators

  • nio_1023