UNPKG

@hhgtech/hhg-components

Version:
33 lines (28 loc) 907 B
/** Clone from this package https://github.com/sindresorhus/hex-rgb/blob/main/index.js */ export interface Options { /** The RGB output format. Note that when using the `css` format, the value of the alpha channel is rounded to two decimal places. @default 'object' */ readonly format?: 'object' | 'array' | 'css'; /** Set the alpha of the color. This overrides any existing alpha component in the Hex color string. For example, the `99` in `#22222299`. The number must be in the range 0 to 1. */ readonly alpha?: number; } export interface RgbaObject { red: number; green: number; blue: number; alpha: number; } export type RgbaTuple = [ red: number, green: number, blue: number, alpha: number ]; export default function hexRgb(hex: string, options: Options): number[];