Rules of Engagement originally ran in 4 bit color. This gives you 24 or 16 colors to play with. With so little colors, you did not have a "transparency". ROE gets around this by assigning black as a "mask". This means that you can have some functions that alter colors, except for black. This becomes useful later.
I'm trying to duplicate this functionality in Allegro 5 with 24 bit color. (If you are counting 224 is 16,777,216 colors to work with. Considerably more!) Besides the boost in colors, I also have variable transparencies as well.
My grief comes down to a function called DoColorMask(). In the original game, the function would copy a bitmap from a source location to a destination. While the the bitmap was pixel-for-pixel being copied over, it would check the color of the pixel being copied. If the pixel isn't black, then change the pixel color to a color you would give it. This means that if you have a solid red colored button with black text, you can use the function to make the button white with black text. This function is often used to make buttons "flash"
The upshot is this is a poor-man's tint function.
Allegro has a comparable function called al_draw_tinted_bitmap_region(). It's promising, except there are issues I'm not sure how to resolve yet.
|Full, Red, Green, and Blue Channels|
|Using alpha to "Push" a channel color|
|Can't go above full brightness|
|Gimps "Colorize" in the blue channel.|