The request was specifically for the S100. But the SX220 and SX240 show the same symptoms. My SX220 still shows the best results.
Here is a screenshot from the S100: http://forum.chdk-treff.de/viewtopic.php?f=7&t=3326&p=31252#p31234
Thanks. All these cameras use custom palette.
It seems like a simple workaround is just to set custom OSD colors in the CHDK menu (OSD background and menu background) As long as you do this with video out enabled, what you see should be what you get. The colors might be bad when you aren't using video out of course. You should be able to use a set_config_value script to switch if it's a problem.
It would be interesting to see screenshots of the CHDK palette display with and without video out.
For a more complete solution...
It sounds like the actual location of the palette used by the camera changes, without affecting active_palette_buffer.
It should be possible to detect the video out present, e.g. in variables used by functions like GetVideoOutType or in physw_status. You might be able to find the location of the actual palette by searching memory for canon color values. If you can do this, you can put as special case in load_chdk_palette / vid_get_bitmap_active_palette
I guess another possibility might be that the interpretation of the palette changes. (e.g. 0x0090000 is no longer interpreted as transparent dark grey) but this seems less likely. You should be able to test this by changing the values used in load_chdk_palette.