GdkColor::red
Access: Read Write
Type: int
Returns the red part of the color in the range from 0 to 65536. If you
convert it to hexadecimal via dechex, you will see
that only the first 2 values are used, the last 2 are zero. So if you
want to convert it to a nice html-like hexadecimal value like
AF, you've got to shift it bitwise.
$orange = &new GdkColor('#FF8000');
echo dechex( $orange->red >> 8);
|
You can use the property to set the red part of the color as well.