From 9ade8a46b63ae7b27f9b153581ac051eedc10d1a Mon Sep 17 00:00:00 2001 From: Brody Nielsen Date: Thu, 15 Jan 2026 18:32:29 -0700 Subject: [PATCH 1/3] Fix #22: Add documentation for converting RGB values to color palette indices Add a new section explaining how to convert arbitrary RGB color values to the closest Push 2 color palette index. This includes: - Instructions for retrieving the complete palette - Distance calculation methods (Euclidean and perceptual) - Alternative approach of modifying the palette with custom colors This addresses the question about translating Max For Live colors to Palette Color Index values. --- doc/AbletonPush2MIDIDisplayInterface.asc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/doc/AbletonPush2MIDIDisplayInterface.asc b/doc/AbletonPush2MIDIDisplayInterface.asc index 34315a1..f0f0805 100644 --- a/doc/AbletonPush2MIDIDisplayInterface.asc +++ b/doc/AbletonPush2MIDIDisplayInterface.asc @@ -441,6 +441,29 @@ Reply: ++[F0 00 21 1D 01 01 **04 7D 00 00 00 00 7F 01 7E 00** F7]++ = entry 125 6+|Example: ++[F0 00 21 1D 01 01 **05** F7]++ = trigger palette reapplication |=== +Converting RGB Values to Color Palette Indices +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Push 2 LEDs do not accept direct RGB values. Colors must be specified using +color palette indices (0-127). To convert an arbitrary RGB color to the closest +available palette index: + +1. Retrieve the complete color palette by querying all 128 entries (0-127) + using the "Get LED Color Palette Entry" command (0x04). + +2. For each palette entry, calculate the distance between your target RGB + color and the palette entry's RGB values. Common distance metrics include: + - Euclidean distance in RGB space: sqrt((R1-R2)² + (G1-G2)² + (B1-B2)²) + - Perceptual color distance (e.g., using LAB color space) for better + visual matching + +3. Select the palette index with the minimum distance. + +Alternatively, you can modify the palette to add custom colors by using the +"Set LED Color Palette Entry" command (0x03) to overwrite existing palette +entries with your desired RGB values. After modifying palette entries, send +the "Reapply Color Palette" command (0x05) to apply the changes. + White LED Color Processing ^^^^^^^^^^^^^^^^^^^^^^^^^^ From dfd145595eb0439085336bc9d2180c17d172712c Mon Sep 17 00:00:00 2001 From: Ununp3ntium115 <126101872+Ununp3ntium115@users.noreply.github.com> Date: Fri, 16 Jan 2026 15:07:13 -0700 Subject: [PATCH 2/3] Update AbletonPush2MIDIDisplayInterface.asc Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- doc/AbletonPush2MIDIDisplayInterface.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/AbletonPush2MIDIDisplayInterface.asc b/doc/AbletonPush2MIDIDisplayInterface.asc index f0f0805..d3e6fca 100644 --- a/doc/AbletonPush2MIDIDisplayInterface.asc +++ b/doc/AbletonPush2MIDIDisplayInterface.asc @@ -453,7 +453,7 @@ available palette index: 2. For each palette entry, calculate the distance between your target RGB color and the palette entry's RGB values. Common distance metrics include: - - Euclidean distance in RGB space: sqrt((R1-R2)² + (G1-G2)² + (B1-B2)²) + - Euclidean distance in RGB space: sqrt((R1-R2)^2 + (G1-G2)^2 + (B1-B2)^2) - Perceptual color distance (e.g., using LAB color space) for better visual matching From b92afeb98359cacb811af349fb0c760a229c0670 Mon Sep 17 00:00:00 2001 From: Ununp3ntium115 <126101872+Ununp3ntium115@users.noreply.github.com> Date: Fri, 16 Jan 2026 15:07:19 -0700 Subject: [PATCH 3/3] Update AbletonPush2MIDIDisplayInterface.asc Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- doc/AbletonPush2MIDIDisplayInterface.asc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/AbletonPush2MIDIDisplayInterface.asc b/doc/AbletonPush2MIDIDisplayInterface.asc index d3e6fca..db2b85c 100644 --- a/doc/AbletonPush2MIDIDisplayInterface.asc +++ b/doc/AbletonPush2MIDIDisplayInterface.asc @@ -454,9 +454,12 @@ available palette index: 2. For each palette entry, calculate the distance between your target RGB color and the palette entry's RGB values. Common distance metrics include: - Euclidean distance in RGB space: sqrt((R1-R2)^2 + (G1-G2)^2 + (B1-B2)^2) - - Perceptual color distance (e.g., using LAB color space) for better - visual matching + - Perceptual color distance (e.g., using CIE L*a*b* (CIELAB) color space + and a ΔE formula) for better visual matching + Perceptual distance in CIELAB is recommended when matching colors based on + how similar they appear to the human eye, while simple Euclidean distance + in RGB space can be sufficient for rough or performance-critical matching. 3. Select the palette index with the minimum distance. Alternatively, you can modify the palette to add custom colors by using the