export interface Theme { font: string; accent: string; dark: boolean; /** The text colour that reads on the accent: white, or near black on a pale accent. */ on: string; } export declare function parseRgb(value: string): { r: number; g: number; b: number; a: number; } | null; /** * Any CSS colour as red, green, blue and alpha. Computed colours come back as written: rgb(), but also oklch(), * color(srgb …) and color-mix() results on modern pages, which a one-pixel canvas reads for us. */ export declare function parseColour(value: string, doc: Document): { r: number; g: number; b: number; a: number; } | null; export declare function luminance(c: { r: number; g: number; b: number; }): number; export type Look = "light" | "dark"; /** The look the author asked for with data-pipeup-theme="light|dark" (anywhere a setting goes, or ), if any. */ export declare function authorLook(doc: Document): Look | null; /** * The colour the page's canvas is painted: 's background, or else 's (a body background spreads to the * whole canvas); with neither, the colour scheme decides (white, or black for a dark scheme). */ export declare function canvasPaint(doc: Document): { r: number; g: number; b: number; }; /** * Whether the page is dark behind Pipeup. It samples the background actually painted behind the column and * panel (the first non-transparent one down the stack at a few points), not just 's, so a page that dresses a * wrapper (or switches theme with a class on one) is read correctly. With nothing painted it asks the page's * `color-scheme`. A mean in the dead band keeps `was`, so a mid-grey page doesn't flip back and forth. */ export declare function pageIsDark(doc: Document, was?: boolean): boolean; /** The page's font and accent colour, for a given look, so Pipeup reads as part of the page. */ export declare function readTheme(root: Element, look: Look): Theme; export declare function applyTheme(layer: HTMLElement, theme: Theme): void;