Colormap

Description These functions are used to modify colormaps. A colormap is an object that contains the mapping between the color values stored in memory and the RGB values that are used to display color values. In general, colormaps only contain significant information for pseudo-color visuals, but even for other visual types, a colormap object is required in some circumstances. There are a couple of special colormaps that can be retrieved. The system colormap (retrieved with gdk_colormap_get_system()) is the default colormap of the system. If you are using GdkRGB, there is another colormap that is important - the colormap in which GdkRGB works, retrieved with gdk_rgb_get_colormap(). However, when using GdkRGB, it is not generally necessary to allocate colors directly. In previous revisions of this interface, a number of functions that take a GdkColormap parameter were replaced with functions whose names began with "gdk_colormap_". This process will probably be extended somewhat in the future - gdk_color_white(), gdk_color_black(), and gdk_color_change() will probably become aliases.

Constructors

this
this(GdkColormap* gdkColormap)

Sets our main struct and passes it to the parent class

this
this(Visual visual, int allocate)

Creates a new colormap for the given visual.

Members

Functions

allocColor
int allocColor(GdkColor color, int writeable, int bestMatch)

Allocates a single color from a colormap.

allocColors
int allocColors(GdkColor[] colors, int writeable, int bestMatch, int[] success)

Allocates colors from a colormap.

change
void change(int ncolors)

Warning gdk_colormap_change is deprecated and should not be used in newly-written code. Changes the value of the first ncolors in a private colormap to match the values in the colors array in the colormap. This function is obsolete and should not be used. See gdk_color_change().

colorsAlloc
int colorsAlloc(int contiguous, gulong[] planes, gulong[] pixels)

Warning gdk_colors_alloc is deprecated and should not be used in newly-written code. Allocates colors from a colormap. This function is obsolete. See gdk_colormap_alloc_colors(). For full documentation of the fields, see the Xlib documentation for XAllocColorCells().

colorsFree
void colorsFree(gulong[] pixels, gulong planes)

Warning gdk_colors_free is deprecated and should not be used in newly-written code. Frees colors allocated with gdk_colors_alloc(). This function is obsolete. See gdk_colormap_free_colors().

colorsStore
void colorsStore(GdkColor[] colors)

Warning gdk_colors_store is deprecated and should not be used in newly-written code. Changes the value of the first ncolors colors in a private colormap. This function is obsolete and should not be used. See gdk_color_change().

doref
Colormap doref()

Warning gdk_colormap_ref has been deprecated since version 2.0 and should not be used in newly-written code. Use g_object_ref() instead. Deprecated function; use g_object_ref() instead.

freeColors
void freeColors(GdkColor[] colors)

Frees previously allocated colors.

getColormapStruct
GdkColormap* getColormapStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getScreen
Screen getScreen()

Gets the screen for which this colormap was created. Since 2.2

getStruct
void* getStruct()

the main Gtk struct as a void*

getVisual
Visual getVisual()

Returns the visual for which a given colormap was created.

queryColor
void queryColor(gulong pixel, GdkColor result)

Locates the RGB color in colormap corresponding to the given hardware pixel pixel. pixel must be a valid pixel in the colormap; it's a programmer error to call this function with a pixel which is not in the colormap. Hardware pixels are normally obtained from gdk_colormap_alloc_colors(), or from a GdkImage. (A GdkImage contains image data in hardware format, a GdkPixbuf contains image data in a canonical 24-bit RGB format.) This function is rarely useful; it's used for example to implement the eyedropper feature in GtkColorSelection.

unref
void unref()

Warning gdk_colormap_unref has been deprecated since version 2.0 and should not be used in newly-written code. Use g_object_unref() instead. Deprecated function; use g_object_unref() instead.

Static functions

getSystem
Colormap getSystem()

Gets the system's default colormap for the default screen. (See gdk_colormap_get_system_for_screen())

getSystemSize
int getSystemSize()

Warning gdk_colormap_get_system_size is deprecated and should not be used in newly-written code. Returns the size of the system's default colormap. (See the description of struct GdkColormap for an explanation of the size of a colormap.)

Variables

gdkColormap
GdkColormap* gdkColormap;

the main Gtk struct

Meta