Did you use "ColorTab" ?
http://chdk.setepontos.com/index.php?topic=4338.msg49038#msg49038This allows you to find/inspect palette data in ROM and later find subs dealing with it.
load_chdk_palette() allows to select one from palette buffers, then there is one separate "active" buffer,
which references current palette.
So for sx200is 100c these are:
1. ROM palette data at FFB5515C
2. palette_buffer 0x15B5A0 and pointer to it, palette_buffer_ptr at 0x8D9C (near that are active_palette_buffer and palette_control).
3. active palette, referenced by 0x5744+0x28.
active_palette_buffers are:
0 shoot mode
3 playback mode
4 video playback
Options 2 and 3 are more or less similar, but 2 allows to change only desired palettes.
I added one more color for transparent gray (for COLOR_BG and COLOR_ALT_BG).
pal[CHDK_COLOR_BASE+13] = 0x00A0000; // Transparent Light Gray
Below are shots for palette in Record and Playback modes (without last color added).