import type { RandomSource } from './number'; import type { RgbArrayType } from './tools/ColorConverter'; export declare function randomHex(random?: RandomSource): string; export declare function blendRgb(rgb1: RgbArrayType, rgb2: RgbArrayType, a1: number): RgbArrayType; export interface StringToHexColorOptions { /** Rotates the whole palette, in degrees. */ hueOffset?: number; /** Hues the string may land on, e.g. `[180, 260]` for blues only. Defaults to the whole wheel. */ hueRange?: [number, number]; /** Fixed lightness, used when `lRange` is unset. Defaults to 65. */ l?: number; /** Lightness range the string picks from, instead of the fixed `l`. */ lRange?: [number, number]; /** Defaults to 40-60. */ sRange?: [number, number]; } /** The same string always gets the same color, spread over the given hue, saturation and lightness ranges. */ export declare function stringToHexColor(str: string, { hueOffset, hueRange, l, lRange, sRange }?: StringToHexColorOptions): string; /** WCAG relative luminance (0-1) of a hex color. */ export declare function luminance(color: string): number; /** WCAG contrast ratio (1-21) between two hex colors, order-insensitive. */ export declare function contrastRatio(color1: string, color2: string): number; /** Whether white text reads better than black on `color` (i.e. the color is dark). */ export declare function isDark(color: string): boolean; /** Opposite of {@link isDark}. */ export declare function isLight(color: string): boolean; /** Lighten a hex color by `amount` (0-1) of the full lightness range. */ export declare function lighten(color: string, amount: number): string; /** Darken a hex color by `amount` (0-1) of the full lightness range. */ export declare function darken(color: string, amount: number): string; export type MixSpace = 'rgb' | 'hsl' | 'oklab' | 'oklch'; /** Blend two hex colors in `space` (RGB by default; `oklab` and `oklch` blend evenly to the eye); `weight` is the proportion of `color2` (0-1, default 0.5). */ export declare function mix(color1: string, color2: string, weight?: number, space?: MixSpace): string; /** Complementary hex color (hue rotated 180deg). */ export declare function complementary(color: string): string; /** Triadic palette: the color plus the two hues 120deg apart. */ export declare function triadic(color: string): [string, string, string]; /** 0..1 alpha as the 2-char hex suffix of an 8-digit hex colour. */ export declare function alphaHex(alpha: number): string; //# sourceMappingURL=colors.d.ts.map