vicente wrote on Aug 15th, 2007, 3:39am:Can one add and subtract binaries numbers, how And in hex.
How to change just one part of the number, for instance the Red portion
shifting is just for multiply and divide
I mean, more than the syntax, I'd like to find good texts about how to deal with this data.
thanks again.
again, read the reference links i posted. the second half of the examples (below the line) cover how to get the red, green, blue, and alpha components out, and then re-assemble them for other uses. you can't really manipulate a color directly by addition and subtraction--you have to break it into red/green/blue, change those values, and then assemble red/green/blue back into an int/color variable.
technically, bit shifting does multiplication and division, but it's not helpful to think about it that way with color data. just think about it as a way to pack and unpack colors into a int/color variable.
...or if you're really stuck, just use red(), green(), blue() and color().