export type ThreadRef = { /** Thread manufacturer + line, e.g. "Madeira Polyneon". */ brand: string; /** Manufacturer catalog number the operator uses to pull the cone. */ code: string; name: string; hex: string; }; export type PantoneMatch = { /** What the customer asked for, e.g. "PMS 186 C" or "#c8102e". */ requested: string; /** Screen-approximate color of the request. */ requestedHex: string; /** Closest stocked thread — final match is confirmed at digitizing. */ thread: ThreadRef; }; export type NearestPantone = { /** Display code, e.g. "PMS 186 C" or "PMS WARM RED". */ code: string; /** Screen-approximate sRGB hex of the matched swatch. */ hex: string; /** Euclidean sRGB distance from the input — 0 is an exact table hit. */ distanceRgb: number; }; export type PantoneMatchQuality = "exact" | "close" | "approximate"; type Rgb = [number, number, number]; export declare const hexToRgb: (hex: string) => Rgb; export declare const isThreadRef: (value: unknown) => value is ThreadRef; export declare const isPantoneMatch: (value: unknown) => value is PantoneMatch; /** * Nearest stocked thread by RGB distance — the same mapping a digitizer does * against the thread rack. Drives stitch-preview quantization and the * auto-extracted thread sequence on the work order. */ export declare const nearestThread: (catalog: ThreadRef[], red: number, green: number, blue: number) => ThreadRef; export declare const threadByHex: (catalog: ThreadRef[], hex: string) => ThreadRef | null; export declare const PMS_APPROX: Record; /** * Nearest PMS_APPROX swatch by RGB distance to a hex color — the reverse of * resolveThreadQuery, used to label an arbitrary artwork color with the * closest common Pantone code. Returns null when the input is not a hex * color. Screen approximation only — final ink match is confirmed against a * physical Pantone book. */ export declare const nearestPantone: (hex: string) => NearestPantone | null; export declare const pantoneMatchQuality: (distanceRgb: number) => PantoneMatchQuality; /** * Resolve a customer color request — a hex value or a common PMS code — * to the nearest stocked thread. Returns null when the input is neither a * hex color nor a PMS number in the built-in table. */ export declare const resolveThreadQuery: (catalog: ThreadRef[], input: string) => PantoneMatch | null; export {};