docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Render color swatches and gradients using truecolor/256-color foreground and background styling to visualize arbitrary user-supplied colors.
labelUppercase is enabled, color names are uppercased before styling, but the color rendering remains unchanged. @testexport type ColorInput = string | [number, number, number] | number;
export interface SwatchOptions {
swatchWidth?: number;
labelUppercase?: boolean;
}
/**
* Builds a swatch table that previews each color with a colored label and background block.
*/
export function renderSwatches(
entries: Array<{ name: string; value: ColorInput }>,
options?: SwatchOptions
): string;
/**
* Creates a gradient preview for a label by interpolating from startColor to endColor over the desired step count.
*/
export function renderGradient(
label: string,
startColor: ColorInput,
endColor: ColorInput,
steps: number
): string;Provides terminal string styling with truecolor and 256-color foreground/background helpers.