How come this says the colors are not in the palette.
Looping thour all the pixels:
The only colour it says it is in the palette, is the colour that is in the palette with id=0, but this says it has id=9, which is black in the palette.
Code: Select all
function get_terrain($x,$y, $style='id') {
$rgb = imagecolorat($this->{'terrain_image'}, $x, $y);
$r = ($rgb >> 16) & 0xFF;
$g = ($rgb >> & 0xFF;
$b = $rgb & 0xFF;
$tmp_id = "$r.$g.$b";
switch ($style){
[cut]
case 'palette_id':
return imagecolorexact($this->{'terrain_image'},$r,$g,$b);
break;
}
[cut]