/** Reference paint colour: `#rrggbb` or `rrggbb`. Throws on a malformed value. */ export declare function hexToRgb(hex: string): { r: number; g: number; b: number; }; /** Hue in degrees (0..360) of an RGB triple, in [0..255]. */ export declare function rgbHue(r: number, g: number, b: number): number; export declare const hexToHue: (hex: string) => number; /** Circular distance between two hues, in degrees (0..180). */ export declare function hueDistanceDeg(a: number, b: number): number; export interface Hsv { h: number; s: number; v: number; } export declare function rgbToHsv(r: number, g: number, b: number): Hsv; /** One view: the car with only its body paint drawn, and the same camera with the paint hidden too (the backdrop alone). */ export interface PaintViewPair { id: string; paint: Buffer; empty: Buffer; } export interface PaintViewStats { id: string; /** Paint pixels in the view (after dropping the 2 px edge ring where the paint blends with the backdrop). */ pixels: number; hueDeg: number; medianSaturation: number; medianValue: number; /** Fraction of the paint pixels with a channel at the display ceiling (>= 250 of 255). */ clippedFraction: number; /** Fraction of the paint pixels washed toward white: bright (value >= 0.8) with under half the reference saturation (chromatic) / near-white (neutral). */ washedFraction: number; } export interface PaintReference { rgb: { r: number; g: number; b: number; }; hsv: Hsv; kind: 'chromatic' | 'neutral'; } /** Reference paint colour -> what to judge. Under 0.2 saturation (white, silver, grey, black) hue is undefined, so only lightness and tint are judged. */ export declare function paintReference(hex: string): PaintReference; export declare function samplePaintView(view: PaintViewPair, ref: PaintReference): Promise; /** Thresholds, all against the reference colour and all documented in the MCP `appearance` reference. */ export declare const PAINT_LIMITS: { /** Rendered saturation (median of the six view medians) as a share of the reference's. Chromatic paints. */ readonly saturationShare: 0.75; /** A chromatic body may not render darker than this share of the reference value (a maroon over-correction). */ readonly minValueShare: 0.55; /** Mean over the views of the share of paint pixels washed toward white (chromatic: bright and under half the reference saturation; neutral: all channels >= 245). */ readonly washedMean: 0.3; /** Neutral paints: tint (saturation) above the reference's by at most this, lightness within this of the reference. */ readonly neutralTint: 0.15; readonly neutralValue: 0.25; /** A neutral reference at or above this value is white/silver: near-white pixels are its colour, so wash is not judged. */ readonly lightNeutralValue: 0.75; /** Fewer paint pixels than this over all views and the paint cannot be judged. */ readonly minPixels: 3000; readonly defaultHueToleranceDeg: 12; }; export interface PaintMaterialFact { name: string; baseColorLinear?: number[] | null; metalness?: number | null; roughness?: number | null; clearcoat?: number | null; ior?: number | null; specularIntensity?: number | null; hasMap?: boolean; } export interface PaintAssert { id: string; pass: boolean; detail: string; measured: Record; } /** What the creator can change, with the material's real values, appended to every failing paint message. */ export declare function paintFixAdvice(materials: PaintMaterialFact[] | null | undefined, ref: PaintReference): string; export declare function rgbToHex(c: { r: number; g: number; b: number; }): string; /** Judge the six paint views against the reference. Pure: numbers in, asserts out. */ export declare function judgePaint(referenceHex: string, views: PaintViewStats[], materials: PaintMaterialFact[] | null | undefined, hueToleranceDeg?: number): PaintAssert[];