28.12.2013, 02:26
Okay so basically, I need to figure out how to add/remove transparency to colors using 'Hex math'.
I know there is a few ways to do it, some right, some wrong. I need to do this correctly.
#define COLOR_WHITE 0xFFFFFFAA
#define TCOLOR_WHITE 0xFFFFFF00
#define COLOR_BLUE 0x0000BBAA
#define TCOLOR_BLUE 0x0000BB00
I know its RRGGBBAA but how would you add/remove the AA Values on the fly as opposed to doing a bunch of checks, if statements and whatever else?
Id like to just remove the TCOLOR's and do a function called SetTransparentColor and use the existing colors, then add/subtract hex values to make them opaque/transparent.
I know there is a few ways to do it, some right, some wrong. I need to do this correctly.
#define COLOR_WHITE 0xFFFFFFAA
#define TCOLOR_WHITE 0xFFFFFF00
#define COLOR_BLUE 0x0000BBAA
#define TCOLOR_BLUE 0x0000BB00
I know its RRGGBBAA but how would you add/remove the AA Values on the fly as opposed to doing a bunch of checks, if statements and whatever else?
Id like to just remove the TCOLOR's and do a function called SetTransparentColor and use the existing colors, then add/subtract hex values to make them opaque/transparent.