gdk-Colormaps-and-Colors: Colormaps and Colors

Description Methods and Functions Detailed Description Structures Convenient Construction Author(s) References

Description

Manipulation of colors and colormaps

Methods and Functions

gdkColormapNew(visual, allocate)
gdkColormapGetSystem()
gdkColormapGetSystemSize()
gdkColormapAllocColors(colormap, colors, writeable, best.match)
gdkColormapAllocColor(object, color, writeable, best.match)
gdkColormapFreeColors(object, colors)
gdkColormapQueryColor(object, pixel)
gdkColormapGetVisual(object)
gdkColormapGetScreen(object)
gdkColorsStore(object, colors)
gdkColorWhite(object)
gdkColorBlack(object)
gdkColorParse(spec)
gdkColorAlloc(object, color)
gdkColorChange(object, color)
gdkColorToString(object)
gdkColormap(visual, allocate)

Detailed 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 gdkColormapGetSystem) 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 gdkRgbGetColormap. 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 - gdkColorWhite, gdkColorBlack, and gdkColorChange will probably become aliases.

Structures

GdkColor

The GdkColor structure is used to describe an allocated or unallocated color. GdkColor is a transparent-type.

pixel

[numeric] For allocated colors, the value used to draw this color on the screen.

red

[integer] The red component of the color. This is a value between 0 and 65535, with 65535 indicating full intensitiy.

green

[integer] The blue component of the color.

blue

[integer] The green component of the color.

GdkColormap

The colormap structure contains the following public fields.

size

For pseudo-color colormaps, the number of colors in the colormap.

colors

An list containing the current values in the colormap. This can be used to map from pixel values back to RGB values. This is only meaningful for pseudo-color colormaps.

Convenient Construction

gdkColormap is the equivalent of gdkColormapNew.

Author(s)

Derived by RGtkGen from GTK+ documentation

References

https://developer.gnome.org/gdk2/stable/gdk2-Colormaps-and-Colors.html


RGtk2 documentation built on Oct. 14, 2021, 5:08 p.m.