Implement the real-time swatch grid visualization and CIEDE2000 (ΔE₀₀) quality scoring that renders during Stage 3 measurement. Each strip read by chartread -u emits a ROW_COLORS_JSON payload; this issue handles parsing, rendering, and colour math.
Toolchain Context
Frontend: Vanilla JS + CSS Grid in Tauri webview
Data source: process:json_row Tauri events emitted by the Rust backend (see Issue #5)
Math: CIEDE2000 implemented in pure JavaScript (no external dependencies)
Implementation Plan
CIEDE2000 Module (src/js/delta_e.js)
Implement the full CIEDE2000 formula per CIE Technical Report 142-2001:
Input: two Lab* triplets [L1, a1, b1], [L2, a2, b2]
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Description
Implement the real-time swatch grid visualization and CIEDE2000 (ΔE₀₀) quality scoring that renders during Stage 3 measurement. Each strip read by
chartread -uemits aROW_COLORS_JSONpayload; this issue handles parsing, rendering, and colour math.Toolchain Context
process:json_rowTauri events emitted by the Rust backend (see Issue #5)Implementation Plan
CIEDE2000 Module (
src/js/delta_e.js)[L1, a1, b1],[L2, a2, b2]computeDeltaE00(lab1, lab2)function.Swatch Grid Renderer (
src/js/swatch_grid.js)process:json_rowevents.row_id,row_index,total_rows, andpatches[]array.device_rgb(ordevice_cmyk) to CSS colour for the "sent" swatchexpected.Labto approximate sRGB for the "expected" swatchmeasured.Labto approximate sRGB for the "measured" swatchdeltaE = computeDeltaE00(expected.Lab, measured.Lab)is_pad: true.row_index / total_rowsas a percentage.Lab-to-sRGB Conversion (
src/js/color_convert.js)New/Modified Files
[NEW]src/js/delta_e.js— CIEDE2000 implementation[NEW]src/js/swatch_grid.js— grid renderer and event listener[NEW]src/js/color_convert.js— Lab ↔ sRGB conversion utilities[MODIFY]src/index.html— swatch grid container in Stage 3 panel[MODIFY]src/styles/main.css— grid layout, traffic light colours, progress barAcceptance Criteria
References