ImageColorAllocate() Problem

From: Date: Fri, 03 Oct 2003 06:23:27 +0000
Subject: ImageColorAllocate() Problem
Groups: php.general 
Request: Send a blank email to php-general+get-164855@lists.php.net to get a copy of this message
I am having a bizzare problem with the imagecolorallocate() function. Maybe all of you can help me! Here is the code: $hex1 = "0x".$color{0}.$color{1}; $hex2 = "0x".$color{2}.$color{3}; $hex3 = "0x".$color{4}.$color{5}; $color = ImageColorAllocate($im, $hex1, $hex2, $hex3); Simple enough! $color starts off as a hex color code minus the #, and then is pulled into each of the 3 alpha values by way for the hex variables. It is later outputted in text: ImageTTFText ($im, $cursive_size, 0, $text1_x, $text1_y, $color, $font1, $cursive_text); Problem: The text is always black. Something strange: If I just type in a randomly selected color, it works! Is there some reason that the values in my variables wouldn't be passing? Thanks in advance, Jed R. Brubaker

« previous php.general (#164855) next »