import type { TreeChartBase } from "./tree-chart"; import type { Vec3 } from "../../theme/palette"; import { type GradientStop } from "../../theme/gradient"; /** * Perceptual luminance for a 0..1 RGB triple. Used by tree-chart label * painters to pick a contrasting text color over each leaf's fill. */ export declare function luminance(r: number, g: number, b: number): number; /** * Sample a gradient and drop the alpha channel. Treemap / sunburst * fills carry alpha separately (see {@link leafRGBA}); this is the * "just give me the RGB" entry point. */ export declare function sampleRGB(stops: GradientStop[], t: number): [number, number, number]; /** * Resolve a leaf's fill color according to the chart's color mode: * - `"numeric"` — sign-aware gradient sample via `colorValueToT`. * - `"series"` / `"empty"` — discrete palette lookup keyed by the * node's `colorLabel` (composite of group_by levels in series mode; * `""` in empty mode, which maps to `palette[0]`). * * Returns RGB only; the alpha channel is applied separately by * {@link leafRGBA} using `negativeAlpha` for leaves whose raw size was * negative. */ export declare function leafColor(chart: TreeChartBase, nodeId: number, stops: GradientStop[], palette: Vec3[]): [number, number, number]; /** * `leafColor` + an alpha channel. Negative-size leaves receive * `negativeAlpha` (mirrors `theme.areaOpacity` for area charts) so * they stay visually distinguishable from positive leaves without * disappearing. */ export declare function leafRGBA(chart: TreeChartBase, nodeId: number, stops: GradientStop[], palette: Vec3[], negativeAlpha: number): [number, number, number, number];