Ich hab hier mal eine kleine Funktion geschrieben mit der man Farben direkt aus HTML-Farbcodes erstellen kann.
function allocate_color_from_hex($handle, $hex) { if (strlen($hex) == 4) $hex = '#' . $hex[1] . $hex[1] . $hex[2] . $hex[2] . $hex[3] . $hex[3]; $red = hexdec(substr($hex, 1, 2)); $green = hexdec(substr($hex, 3, 2)); $blue = hexdec(substr($hex, 5, 2)); return imagecolorallocate($handle, $red, $green, $blue); }
Benutzung:
$color = allocate_color_from_hex($picture, "#123456");
Vielleicht ist die ja nicht nur für mich nützlich.

Kommentare
Keine Kommentare bis jetzt.