UNPKG

nhb-toolbox

Version:

A versatile collection of smart, efficient, and reusable utility functions, classes and types for everyday development needs.

44 lines (43 loc) 1.41 kB
import type { Hex6, Hex8, HSL, HSLA, RGB, RGBA } from './types'; /** * Checks if a color is in `Hex` format. * * @param color Color to check. * @returns Boolean: `true` if it's a `Hex` color, `false` if not. */ export declare function isHex6(color: string): color is Hex6; /** * Checks if a color is in `Hex8` format. * * @param color Color to check. * @returns Boolean: `true` if it's a `Hex8` color, `false` if not. */ export declare function isHex8(color: string): color is Hex8; /** * Checks if a color is in `RGB` format and within valid ranges. * * @param color Color to check. * @returns `true` if it's a `RGB` color, `false` if not. */ export declare function isRGB(color: string): color is RGB; /** * Checks if a color is in `RGBA` format and within valid ranges. * * @param color Color to check. * @returns `true` if it's a `RGBA` color, `false` if not. */ export declare function isRGBA(color: string): color is RGBA; /** * Checks if a color is in `HSL` format and within valid ranges. * * @param color Color to check. * @returns `true` if it's a `HSL` color, `false` if not. */ export declare function isHSL(color: string): color is HSL; /** * Checks if a color is in `HSLA` format and within valid ranges. * * @param color Color to check. * @returns `true` if it's a `HSLA` color, `false` if not. */ export declare function isHSLA(color: string): color is HSLA;