Next: Pixmap object Prev: Graphics Context object Up: Xt Top: Top

3.7. Colormap object

Colormap objects are used to represent the Colormap type. A Colormap object can be obtained using the widget method CreateColormap (which also needs a Visual Info object) or the widget method DefaultColormapOfScreen. A Colormap object can be used in the widget method SetWindowColormap and as the colormap resource of widgets.

Colormap objects (cm_objects) have the following methods:

AllocColor (red, green, blue) -- Method on Colormap object
Returns (pixel, red, green, blue, flags). This function corresponds with XAllocColor.
AllocColorCells (contig, nplanes, npixels) -- Method on Colormap object
Returns (plane_masks_list, pixels_list). This function corresponds with XAllocColorCells.
AllocNamedColor (color_name) -- Method on Colormap object
Returns ((screen_def.pixel, screen_def.red, screen_def.green, screen_def.blue, screen_def.flags), (exact_def.pixel, exact_def.red, exact_def.green, exact_def.blue, exact_def.flags)). This function corresponds with XAllocNamedColor.
FreeColors (pixel_list, planes) -- Method on Colormap object
Returns None. This function corresponds with XFreeColors.
Install () -- Method on Colormap object
Returns None. This function corresponds with XInstallColormap.
InstallColormap () -- Method on Colormap object
Returns None. This function corresponds with XInstallColormap.
LookupColor (color_name) -- Method on Colormap object
Returns ((exact_def.pixel, exact_def.red, exact_def.green, exact_def.blue, exact_def.flags), (screen_def.pixel, screen_def.red, screen_def.green, screen_def.blue, screen_def.flags)). This function corresponds with XLookupColor.
ParseColor (color_name) -- Method on Colormap object
Returns (pixel, red, green, blue, flags). This function corresponds with XParseColor.
QueryColor (pixel) -- Method on Colormap object
Returns (pixel, red, green, blue, flags). This function corresponds with XQueryColor.
QueryColors (pixel_list) -- Method on Colormap object
Returns XColor_list. This function corresponds with XQueryColors.
StoreColors (color_list) -- Method on Colormap object
Returns None. This function corresponds with XStoreColors.