Advertisement
hey all,
I am working on a project where the user selects a color in a Flash movie and the color value is then passed to a PHP script.
The color value returned by the Flash application is a 32-bit integer with an Alpha channel value of 0. I would like to convert that to its RGB hexadecimal value but have not been able to figure out how. I found Google results about using the bitwise operator to make the conversion in the other direction (from a known RGB hex to an integer), but if I read it right, it does not look like I can use the same process in reverse.
Is there a simple way to do this? Your advice is much appreciated!
I am working on a project where the user selects a color in a Flash movie and the color value is then passed to a PHP script.
The color value returned by the Flash application is a 32-bit integer with an Alpha channel value of 0. I would like to convert that to its RGB hexadecimal value but have not been able to figure out how. I found Google results about using the bitwise operator to make the conversion in the other direction (from a known RGB hex to an integer), but if I read it right, it does not look like I can use the same process in reverse.
Is there a simple way to do this? Your advice is much appreciated!
Advertisement
Advertisement
-
Re: 32-bit integer to RGB hex conversion
Fri, September 11, 2009 - 5:01 PMNot a very sexy topic I know...
It took a while but eventually i found a very useful solution posted in the comments section for the intval function on php.net:
us3.php.net/manual/en/fu...val.php#91342
so if you ever find yourself needing to perform this conversion, check it out!