//#region src/common/colorScales.d.ts /** RGB triplet with each channel in the range 0-255. */ type Rgb = [number, number, number]; /** A stop on a continuous color scale, positioned at `t` in the range 0-1. */ interface ContinuousColorStop { t: number; color: string; } /** * A band on a stepped color scale. `threshold` is the upper bound of the band * on the normalized 0-1 value range; `label` is rendered above the band in the * legend. */ interface SteppedColorStop { threshold: number; color: string; label: string; } /** * How values map to colors, both in a visualization and in its legend. A * continuous scale interpolates between its stops and renders as a gradient * bar; a stepped scale renders as discrete bands. */ type ColorScale = { kind: "continuous"; stops: ContinuousColorStop[]; } | { kind: "stepped"; stops: SteppedColorStop[]; }; /** * Perceptually uniform sequential scale (matplotlib's plasma), the default for * value overlays. */ declare const PLASMA_COLOR_SCALE: ColorScale; /** * Colors a raw value against a scale, normalizing it into `min`-`max` first. * Returns null when the value sits at or below `min`, or when the range is * degenerate, so callers can fall back to a neutral color. */ declare function sampleColorScale(scale: ColorScale, value: number, max: number, min?: number): Rgb | null; /** CSS `linear-gradient` spanning a continuous scale, for the legend bar. */ declare function toCssGradient(stops: ContinuousColorStop[]): string; //#endregion export { sampleColorScale as a, SteppedColorStop as i, ContinuousColorStop as n, toCssGradient as o, PLASMA_COLOR_SCALE as r, ColorScale as t };