# Save this as init_colors.pl # Other scripts call this function sub InitColors { my($im) = $_[0]; # Allocate colors $white = $im->colorAllocate(255,255,255); $black = $im->colorAllocate(0,0,0); $red = $im->colorAllocate(255,0,0); $blue = $im->colorAllocate(0,0,255); $green = $im->colorAllocate(0, 255, 0); $brown = $im->colorAllocate(255, 0x99, 0); $violet = $im->colorAllocate(255, 0, 255); $yellow = $im->colorAllocate(255, 255, 0); }