/** * Color-resolution helpers. * * Any user-supplied color field on Node / Region / Connector / Note / * NodeBadge is routed through these helpers. The contract: * * Input Output * ----- ------ * undefined undefined * 'primary' etc. theme[key] (resolved theme color) * 'primary/20' '#rrggbb20' (hex + alpha byte) * '#e8792f', 'red', etc. passed through untouched * * `resolveColor()` returns a single string (or undefined) — suitable for * direct use in `fill` / `stroke`. * * `resolveRegionFill()` returns {fill, opacity?}. When the user writes a * BARE theme keyword on a region, the keyword resolves to the theme color * AND fill-opacity is set to DEFAULT_REGION_ALPHA so the region reads as a * subtle tint (matching the existing `#rrggbb12` hand-rolled convention). * Literals and keyword-with-alpha forms pass through unchanged — the user * is presumed to have chosen the opacity explicitly. */ import type { DiagramTheme, ThemeColorKey } from '../types.js'; export declare const KEYS: ThemeColorKey[]; /** Hex alpha byte used for node ring backgrounds (≈8%). */ export declare const NODE_RING_FILL_ALPHA: number; /** Default fill-opacity for regions whose color is a bare theme keyword. */ export declare const DEFAULT_REGION_ALPHA: number; /** * Resolve a color value. Supports theme keywords, keyword/AA alpha * syntax, and CSS literals. Returns a single string (or undefined). */ export declare function resolveColor(color: string | undefined, theme: DiagramTheme): string | undefined; /** Returned fill pair — `opacity` is undefined when no auto-tint applies. */ export interface ResolvedFill { fill: string; opacity?: number; } /** * Resolve a region's color field into a (fill, fill-opacity) pair. Bare * theme keywords auto-tint with DEFAULT_REGION_ALPHA; everything else * passes through untouched (the user chose the exact color themselves). * * Returns { fill: 'none' } when color is undefined / empty. */ export declare function resolveRegionFill(color: string | undefined, theme: DiagramTheme): ResolvedFill; /** True when a color value (literal or keyword) counts as transparent. */ export declare function isTransparent(color: string | undefined): boolean; //# sourceMappingURL=colors.d.ts.map