I'm trying to write text onto an image and when I use ImageTTFText, it works, but only in light blue or black. In the following example, the first two imageTTFtexts show up light blue and the third one show up black. What's strange (to me) is that the colors for the first two were allocated, but the color for the third one was not. Here's my code:
<?php
Header("Content-Type: image/png");
$im=imageCreateFromJpeg("bgregsmiling.jpg");
$black = ImageColorAllocate($im, 0, 0, 0);
$white = ImageColorAllocate($im, 255, 255, 255);
$font="/home/virtual/site2/fst/var/www/html/fonts/ALPHA.TTF";
imageTTFtext($im,50,0,20,100,$black,$font,"Greg");
imageTTFtext($im,50,0,20,200,$white,$font,"Greg");
imageTTFtext($im,50,0,20,300,$red,$font,"Greg");
imagepng($im);
imageDestroy($im);
?>