how can i create an opposite of a hexadecimal color? for example, i'd like to convert 0x000000 (black) into 0xFFFFFF (white), or 0xFF0000 (red) into 0x00FFFF (cyan). those are rather basic colors, while variants of colors can have more complex hexadecimal values, such as 0x21B813 (greenish).
are bitwise operators required for this? maybe a loop of each digit to calculate it's mirror from 0 to 15, or 0 to F (0 become F, 6 becomes 9, etc.)
i'm using ActionScript, so i'm almost certain that this would be done the same way in Java.