Image.colormap

Access the image color map. Only ClassType.PsseudoClass images have a colormap.

Color color = image.colormap[2];
image.colormap()[2] = color;

To asign the complete colormap at once:

1 Color[] colors = new Colors[255];
2 image.colormap() = colors;
3 //Or
4 image.colormap.size = 255;
5 foreach(i, color; colors)
6    image.colormap()[i] = color;
class Image
colormap
(
)

Bugs

because of dmd bug 2152 the parentheses are needed when assigning;

Meta