| Author |
Hexadecimal values and bitwise operators.
|
Suman Sharma
Ranch Hand
Joined: May 16, 2005
Posts: 72
|
|
Can anyone explain me what is happening in each line of these two methods? Thank you.
|
 |
Kaydell Leavitt
Ranch Hand
Joined: Nov 18, 2006
Posts: 679
|
|
This first method masks off the alpha channel. If you count the number of f's in the mask, there are 6, each of which is 4 bits wide. This is a 24 bit mask. Each color in RGB is 8 bits times three which is also 24 bits. The 8 bits that is left over is the "alpha channel". The alpha channel contains non-color information such as transparency: Alpha Channel The above code converts the RGB color value to a hexadecimal String (base 16). The following code calculates the complementary color: In the above code, there is no need to mask out the alpha channel because the RGB codes are fetched individually and the alpha channel is never here. Kaydell
|
 |
Suman Sharma
Ranch Hand
Joined: May 16, 2005
Posts: 72
|
|
|
Thank you for your help.
|
 |
 |
|
|
subject: Hexadecimal values and bitwise operators.
|
|
|