I have a database which contains my color definitions for GD2 in the format: ColorName, Red, Green, Blue Example: Red, 255, 0, 0 I am pulling the values from the database and want to assign them via GD2"imagecolorallocate", I just can't seem to get my head around it this morning, so please help if you can... This is the code I have so far. SQL="Select * From Colors"; $ColorValues = mysql_query($SQL); while $Values = mysql_fetch_array($ColorValues) { $ColorName = $Values["Name"]; $Red = $Values["Red"]; $Green = $Values["Green"]; $Blue = $Values["Blue"]; } PHP:
$color = imagecolorallocate ( $image, $Red, $Green, $Blue); Code (markup): that's it. $image must be an image resources identifier. regards