To go to and from sketchmaker.php, I have been using serialize() and unserialize(). My colors are generated in Flash as 0xFFFFFF values. After they are sent to PHP and unserialized, they become decimals, and I must run dechex to restore them. If I have any degree of red, I get a 6 character hex and this works great; however, if I use a blue or green tone without a red component, I get odd results. Green becomes yellow (perhaps 00FF55 is being read as FF5500?) and blue becomes black ( ).
By restoring the hex to 6 characters, PixelSetColor works as advertised.
It could be argued that this is not MagickWand's fault; however, since PHP dechex throws away leading zeroes (and serialize/unserialize converts hex to decimals), it seems that MW should correctly interpret any hex <= 6 characters as its 6 character equivalent.
If anyone is having their colors mucked with going between Flash and ImageMagick/MagickWand, try this code:
Code: Select all
$thiscolor="#";
for($i=1; $i<=(6-strlen(dechex($thisline[0]))); $i++){
$thiscolor.="0";
}
$thiscolor.=dechex($thisline[0]);