Haiku API Bindings
color_map
Not logged in

Documentation | InterfaceKit | color_map

DESCRIPTION

Exposes the C++ color_map struct as a native map.

A color map is a table of 256 colors, making a set of 4-byte colors available with a 1-byte index.

FIELDS

id

An integer id.

color_list

A native list of rgb_color structures.

inversion_map

A native list of integers.

Normally, you find the inverse of a color by inverting the bits of the color value. But if you did that with an index, there's no guarantee that the color at the inverted index will be the inverse of the original color.

So this map allows you to find the inverse of a color. For a given color at index n in color_list, the value at index n in inversion_map will be the index of the inverted color.

index_map

A native list of integers. Each index into this list is a 2-byte integer containing a 15-bit color. The value at the index is an index into color_list; the value at that index will be the closest match to the 15-bit color.