module

CrImage::PalettedImage

Inherits CrImage::Image

PalettedImage is an image whose colors may come from a limited palette. If m is a PalettedImage and m.color_model() returns a Color::Palette p, then m.at(x, y) should be equivalent to p[m.color_index_at(x, y)]. If m's color model is not a Color::Palette, then color_index_at's behavior is undefined.

Instance methods

color_index_at(x : Int32, y : Int32) : UInt8

color_index_at returns the pallete index of the pixel at (x,y).

Source