@library/color
v0.0.5
Published
## Installation
Readme
@library/color
Installation
npm
npm install @library/coloryarn
yarn add @library/colorAPI
hexToRgb
Convert a hexadecimal color code to its corresponding RGBA representation.
import { hexToRgb } from "@library/color";
hexToRgb("#f00"); // { r: 255, g: 0, b: 0, a: 1 }
hexToRgb("#f000"); // { r: 255, g: 0, b: 0, a: 0 }
hexToRgb("#7f11e0"); // { r: 127, g: 17, b: 224, a: 1 }
hexToRgb("#11223344"); // { r: 17, g: 34, b: 51, a: 0.27 }