import type { ResolvedConfig } from '../vdt.js'; /** * The attribute {@link applySingleInkToSvg} writes on the root `` of * the markup it recolours, naming the ink (`data-postext-single-ink="#1f3a93"`). * Markup that carries it is never recoloured again — the mapping is not * idempotent, so a second pass would lighten every colour: black would come * out at `1 − luminance(ink)` of the ink. */ export declare const SINGLE_INK_MARK = "data-postext-single-ink"; /** Whether SVG markup was recoloured by {@link applySingleInkToSvg} already: * its root element carries {@link SINGLE_INK_MARK}. */ export declare function isSingleInkSvg(svgText: string): boolean; /** * Whether an image URL is an SVG data URI whose markup carries * {@link SINGLE_INK_MARK} — a picture recoloured by * {@link applySingleInkToSvg} before it was handed over as a URL. Only the * head of the payload is read. A blob or network URL cannot tell (false). */ export declare function isSingleInkSvgUrl(url: string): boolean; /** * Recolour an SVG document to tints of a single ink. * * The result carries {@link SINGLE_INK_MARK} on its root element, and * markup that already carries it is returned as it is — whatever ink it * names — so a picture is never tinted twice, whichever of the host and * the backends recolours it first. * * @param svgText The SVG markup. * @param inkHex The ink colour as a hex string (e.g. `'#295AA3'`). * @returns The recoloured markup; returns the input unchanged when `inkHex` * cannot be parsed or the markup is marked as recoloured already. */ export declare function applySingleInkToSvg(svgText: string, inkHex: string): string; /** * Recolour RGBA pixels in place to tints of a single ink — the mapping of * {@link applySingleInkToSvg}, applied to a rendered picture instead of its * markup (the canvas backend's path for SVG images it was handed decoded). * Alpha is kept; fully transparent pixels are skipped. * * @returns false (and leaves `data` as it was) when `inkHex` cannot be parsed. */ export declare function applySingleInkToPixels(data: Uint8ClampedArray, inkHex: string): boolean; /** * The same mapping as the 4×5 matrix of an SVG `feColorMatrix` (values row * by row, on 0..1 gamma-encoded channels — use it with * `color-interpolation-filters="sRGB"`): each channel becomes * `ink + (1 − ink) · luminance`, alpha passes through. The HTML backend * filters SVG ``s with it. Null when `inkHex` cannot be parsed. */ export declare function singleInkColorMatrix(inkHex: string): number[] | null; /** The ink a document's SVG pictures are recoloured to — its resolved * `diagramStyle.inkColor` — or null when `diagramStyle.singleInk` is off. * Shared by the canvas, HTML and PDF backends. */ export declare function documentInkHex(config: Pick): string | null; //# sourceMappingURL=singleInk.d.ts.map