function hexToRgb
hexToRgb(hex: string): { r: number; g: number; b: number; } | null

Converts a HEX color to an RGB color.

Parameters

hex: string
  • HEX color string

Return Type

{ r: number; g: number; b: number; } | null

RGB color object

Usage

import { hexToRgb } from "sgr/index.ts";