process[learn]ing

learning

since this is called process[learn]ing I figure I should share what I learn.  Today I noticed something in the reference that I never thought of before. Colors in processing are represented as integers, so you can do bitwise operations on them.
Each color has eight hexadecimal digits like 0xFFCC405D or something.  The first two digits are the alpha, second are red, third are green, fourth are blue. The values go from 0x00 (0) to 0xFF (255) for each.

I don’t really know what this all entails, but I know you could change colors using bitmasks and extract the individual components of a color using bit shifting.
And bitwise operations are generally faster than other operations, so it’d be good for say modifying the color of each pixel in a video frame.

Hope this helps.

  1. jtoprocessing posted this