function htmlcolor($img,$color) { sscanf($color, "%2x%2x%2x", $red, $green, $blue); return ImageColorAllocate($img,$red,$green,$blue); return($c); } $red=htmlcolor($img,"FF0000");