npm.io
2.1.0 • Published 5 years ago

@fantasy-color/from-rgba

Licence
MIT
Version
2.1.0
Deps
1
Size
6 kB
Vulns
0
Weekly
0
Stars
51

@fantasy-color/from-rgba

Parse a CSS RGBA string into a RGBA object.

type fromRgba = (rgb: string) => RGBA

Example usage:

import fromRgba from '@fantasy-color/from-rgba'

fromRgba('rgb(0, 250, 10, 0.6)')
// { red: 0, green: 250, blue: 10, alpha: 0.6 }