Skip to content

Commit 9ade8a4

Browse files
Brody NielsenBrody Nielsen
authored andcommitted
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.
1 parent 7ba2816 commit 9ade8a4

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

doc/AbletonPush2MIDIDisplayInterface.asc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,29 @@ Reply: ++[F0 00 21 1D 01 01 **04 7D 00 00 00 00 7F 01 7E 00** F7]++ = entry 125
441441
6+|Example: ++[F0 00 21 1D 01 01 **05** F7]++ = trigger palette reapplication
442442
|===
443443

444+
Converting RGB Values to Color Palette Indices
445+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
446+
447+
Push 2 LEDs do not accept direct RGB values. Colors must be specified using
448+
color palette indices (0-127). To convert an arbitrary RGB color to the closest
449+
available palette index:
450+
451+
1. Retrieve the complete color palette by querying all 128 entries (0-127)
452+
using the "Get LED Color Palette Entry" command (0x04).
453+
454+
2. For each palette entry, calculate the distance between your target RGB
455+
color and the palette entry's RGB values. Common distance metrics include:
456+
- Euclidean distance in RGB space: sqrt((R1-R2)² + (G1-G2)² + (B1-B2)²)
457+
- Perceptual color distance (e.g., using LAB color space) for better
458+
visual matching
459+
460+
3. Select the palette index with the minimum distance.
461+
462+
Alternatively, you can modify the palette to add custom colors by using the
463+
"Set LED Color Palette Entry" command (0x03) to overwrite existing palette
464+
entries with your desired RGB values. After modifying palette entries, send
465+
the "Reapply Color Palette" command (0x05) to apply the changes.
466+
444467
White LED Color Processing
445468
^^^^^^^^^^^^^^^^^^^^^^^^^^
446469

0 commit comments

Comments
 (0)