diff --git a/src/lib/theme-contrast.ts b/src/lib/theme-contrast.ts index 49b9412d..41d84688 100644 --- a/src/lib/theme-contrast.ts +++ b/src/lib/theme-contrast.ts @@ -28,7 +28,7 @@ export interface AdminPalette { } /** Pure / near-white public surfaces → soft admin paper (less eye strain). */ -function softLightSurface( +export function softLightSurface( value: string | undefined, softDefault: string, ): string { @@ -262,7 +262,7 @@ export function ensureReadableThemeColors( return out; } -function parseHex(value: string): Rgb | null { +export function parseHex(value: string): Rgb | null { const trimmed = value.trim(); const short = /^#([0-9a-f]{3})$/i.exec(trimmed); if (short) { @@ -282,7 +282,7 @@ function parseHex(value: string): Rgb | null { ]; } -function relativeLuminance(rgb: Rgb): number { +export function relativeLuminance(rgb: Rgb): number { const [red, green, blue] = rgb.map((channel) => { const value = channel / 255; return value <= 0.04045 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4;