2.1.2 • Published 3 years ago

@help-me/hex-2-rgb v2.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

hex-2-rgb

Super lightweight typescript helper function to convert hexes of format #RRGGBB to rgb of value rgb(x,y,z) or rgba(x,y,z,a).

Installation

npm install @help-me/hex-2-rgb

Usage

import { hex2rgb } from '@help-me/hex-2-rgb'

const rgb = hex2rgb('#000000')
console.log(rgb) // rgba(0, 0, 0)

const rgba = hex2rgb('#FFFFFF', 0.5)
console.log(rgba) // rgba(255, 255, 255, 0.5)

Size limit

Smaller than 150 bytes (minified and gzipped). No dependencies.

Size Limit controls the size.

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago