4.7 Colormap

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)
Returns (pixel, red, green, blue, flags). This function corresponds with XAllocColor.

AllocColorCells( contig, nplanes, npixels)
Returns (plane_masks_list, pixels_list). This function corresponds with XAllocColorCells.

AllocNamedColor( color_name)
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.

CopyColormapAndFree( )
Returns cm_object. This function corresponds with XCopyColormapAndFree.

FreeColors( pixel_list, planes)
This function corresponds with XFreeColors.

Install( )
This function corresponds with XInstallColormap.

InstallColormap( )
This function corresponds with XInstallColormap.

LookupColor( color_name)
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)
Returns (pixel, red, green, blue, flags). This function corresponds with XParseColor.

QueryColor( pixel)
Returns (pixel, red, green, blue, flags). This function corresponds with XQueryColor.

QueryColors( pixel_list)
Returns XColor_list. This function corresponds with XQueryColors.

StoreColors( color_list)
This function corresponds with XStoreColors.