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:

Color[] colors = new Colors[255];
image.colormap() = colors;
//Or
image.colormap.size = 255;
foreach(i, color; colors)
    image.colormap()[i] = color;
class Image
colormap
()

Bugs

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

Meta