/** * Apply an alpha to a hex color, returning an `rgba(...)` string. Replaces the * engine's `bg-primary/10`-style alpha suffix: `alpha(tokens.primary, 0.1)`. * Accepts #rgb, #rgba, #rrggbb and #rrggbbaa. The supplied opacity replaces any * existing hex alpha. Finite opacity is clamped to 0..1. Invalid hex, non-finite * opacity and non-hex inputs (including rgba() and "transparent") pass through. */ export declare function alpha(color: string, a: number): string; /** * An `oklch(L C h)` colour as the `#rrggbb` a browser paints for it: Oklab to linear sRGB, * then each channel clipped to the displayable range, which is what Chrome renders for the * v4 hand-off's accents (tools/v4/accent-samples.json). The accent palettes are authored in * oklch and React Native cannot parse it, so the kit converts here. */ export declare function oklchHex(L: number, C: number, hueDeg: number): string; /** * A colour's oklch lightness, chroma and hue (degrees, 0..360), the inverse of `oklchHex`, or * null when it is not opaque #rgb or #rrggbb hex. The token gates read a neutral's tint * with it: a hand-off neutral is hex, and its hue and chroma say which family it is in. */ export declare function oklchOf(color: string): [number, number, number] | null; /** * Blend `over` into `base` by `t` (a 0..1 fraction) in the Oklab space, returning * an `rgb(...)` string. The RN equivalent of the hand-off's * `color-mix(in oklab, %, )`, matching it channel for channel, * so a skin can transcribe a blended CSS fill without a web colour function. * * Both colours must be opaque #rgb or #rrggbb hex (the default token shape). * Translucent hex (#rgba or #rrggbbaa), functional colors and "transparent" * return `base` unchanged. This helper does not discard or blend source alpha. */ export declare function mixOklab(base: string, over: string, t: number): string; /** * Blend `over` into `base` by `t` (a 0..1 fraction) in OKLCH, returning `#rrggbb`: the RN * equivalent of the hand-off's `color-mix(in oklch, %, )`. Lightness and * chroma blend linearly and the hue along the shorter arc. A near-grey has no hue of its own * and takes the other's, as Chrome treats a hex colour whose chroma is under 0.02 (measured * against its `color-mix`: 0.0196 has no hue, 0.0204 keeps its own). Both colours must be * opaque hex; otherwise `base` comes back unchanged. */ export declare function mixOklch(base: string, over: string, t: number): string; /** A colour's sRGB channels and alpha, or null when it is not a hex or rgb(a) string. */ export declare function channelsOf(color: string): [number, number, number, number] | null; /** `tint` composited over the opaque `base` (source-over), as an `rgb(...)` string. */ export declare function composite(tint: string, base: string): string; /** WCAG 2 relative luminance of an opaque colour (alpha is ignored). */ export declare function relativeLuminance(color: string): number; /** WCAG 2 contrast ratio between two opaque colours (1 when either does not parse). */ export declare function contrastRatio(a: string, b: string): number; /** * The WCAG 2 contrast of `ink` on `tint` composited over the opaque `base`: the lower of the * exact blend's and `composite`'s rounded channels', so a floor solved with it holds whichever * way a renderer resolves the blend (1 when a colour does not parse). */ export declare function contrastOver(tint: string, base: string, ink: string): number; /** The ink a colour carries best: white or near-black, whichever contrasts more. */ export declare function inkOn(color: string): string; //# sourceMappingURL=color.d.ts.map