Yup, now it works in RGB mode too. Perfect! We need to get this thing to trunk, or can anyone think of a reason not to? This is a major improvement.
Well, as
PhyrePhoX said, I might be confusing trunk a little with all these patches. Now that a couple of them are in apparently good shape, I should put them together in a single, clean patch for trunk to look at, I think.
For instance, the draw_guard_pixel() function that I used both here and in the face detection patch should really be exported from gui_draw.c instead of duplicated.
I agree. There isn't a way to disable the half-shoot exposure OSD witout CHDK either, is there? If someone wants it gone for some reason, that's a separate feature which needs more work I guess. And it shouldn't be zebra related. I find it unlikely that anyone has used zebra for that particular purpose...someone speak out if you did 
Honestly, I'm not sure why anyone would disable half-shoot OSD at all

)
Maybe in manual mode, but in the automatic modes it contains pretty much essential information...
As for what could be further improved in zebra: I think those slowest blink zebra modes are now unnecessary (Blink 3 and 2), but faster blink rates could now be useful instead.
Yeah, that works and makes sense.
Also, it would be nice if zebra could be also drawn under CHDK OSD gray transparent areas (I keep a 6-line misc osd on display, the rectangle takes up quite a bit of space while most of it is just background, not text) and histogram transparent areas (one thing that especially catches my attention is the histogram multiplier field on top-left corner of the histogram... it's empty when the histogram isn't scaled, but zebra never draws there).
Hm, this makes a lot of sense (consider that the Canon OSD itself disables all elements that have a background, in half-shoot mode), but it's harder to implement than it sounds.
I can ask the OSD to use COLOR_TRANSPARENT for the background during half-shoot/zebra mode, but that will just make the background transparent, it won't let zebra draw over it.
That's because the buffer I'm keeping to check for whether or not I should draw zebra on pixels only contains the Canon OSD at the time just after pressing the half-shoot button. It's not updated, and it doesn't contain the CHDK OSD. It could be made to contain the CHDK OSD, but then it wouldn't get updated. And if it were updated, the problem of zebra "leaving trails" would surface back.
I could keep yet another separate buffer just for the CHDK OSD, but I feel I'm starting to allocate a tad too much precious memory.
But don't despair! If it can't be done in gui_osd.c, it can be done further up the hill in gui_draw.c.
I modified draw_char() so that, then the background color is transparent, nothing at all is drawn there.
That made the text unreadable on white backgrounds, so I also did something to give text a black border (much like Canon's own font; I like it).
The only problem is that, erm... I wouldn't suggest using color 0x00 as the
standard background color anymore. Perhaps a new "fake" color should be defined, like COLOR_NEVER_DRAW. Except all 255 of them are already taken.
I also had to modify the histogram drawing code, because it wouldn't use the standard OSD colors. There are a couple of other things in the OSD that don't use OSD colors, so they'll still not be transparent, but I couldn't modify those now as they're scattered in several files.