/** * Types for `oklch.mjs`. * * Hand-written rather than emitted. `tsconfig.json` does not set `allowJs` — and * must not: turning it on would pull every `scripts/*.mjs` into the same program * that type-checks `src`, for tooling that is never published. A `.d.mts` beside * the module is what lets `test/contrast.test.ts` import it with no compiler * option changed. Keep the two in step by hand; there are six exports. */ export type Oklch = { L: number; C: number; H: number }; /** oklch → linear sRGB. Unclamped: a channel outside 0–1 is out of gamut. */ export function oklchToLinearRgb(L: number, C: number, H: number): [number, number, number]; /** linear sRGB → oklch. */ export function linearRgbToOklch(r: number, g: number, b: number): Oklch; /** linear → gamma-encoded sRGB (0–1). */ export function gammaEncode(v: number): number; /** gamma-encoded → linear sRGB (0–1). */ export function gammaDecode(v: number): number; /** oklch → `#RRGGBB`, clamped to gamut the way a browser clamps it. */ export function oklchToHex(L: number, C: number, H: number): string; /** `#RGB` / `#RRGGBB` → oklch. Throws on anything else. */ export function hexToOklch(hex: string): Oklch; /** `{L,C,H}` → the exact `oklch(L C H)` spelling tokens.css is parsed with. */ export function formatOklch(colour: Oklch): string;