The color to allocate. On return the <structfield>pixel</structfield> field will be filled in if allocation succeeds.
writeable
If true, the color is allocated writeable (their values can later be changed using gdk_color_change()). Writeable colors cannot be shared between applications.
best_match
If true, GDK will attempt to do matching against existing colors if the color cannot be allocated as requested.
Returns:
true if the allocation succeeded.
int Gdk::Colormap::alloc_colors
(
GdkColor*
colors,
int
ncolors,
bool
writeable,
bool
best_match,
gboolean*
success
)
Allocates colors from a colormap.
Parameters:
colors
The color values to allocate. On return, the pixel values for allocated colors will be filled in.
ncolors
The number of colors in colors .
writeable
If true, the colors are allocated writeable (their values can later be changed using gdk_color_change()). Writeable colors cannot be shared between applications.
best_match
If true, GDK will attempt to do matching against existing colors if the colors cannot be allocated as requested.
success
An array of length ncolors . On return, this indicates whether the corresponding color in colors was sucessfully allocated or not.
Returns:
The number of colors that were not sucessfully allocated.
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 alloc_colors(), or from a Gdk::Image. (A Gdk::Image contains image data in hardware format, a Gdk::Pixbuf 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 Gtk::ColorSelection.
Parameters:
pixel
Pixel value in hardware display format.
result
Gdk::Color with red, green, blue fields initialized.