ruby-****@sourc*****
ruby-****@sourc*****
2003年 11月 8日 (土) 15:14:23 JST
------------------------- REMOTE_ADDR = 218.231.180.123 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/?Gdk%3A%3AColormap ------------------------- = class Gdk::Colormap 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.system) is the default colormap of the system. If you are using Gdk::RGB, there is another colormap that is important - the colormap in which Gdk::RGB works, retrieved with Gdk::RGB.colormap. However, when using Gdk::RGB, it is not generally necessary to allocate colors directly. + There are a couple of special colormaps that can be retrieved. The system colormap (retrieved with Gdk::Colormap.system) is the default colormap of the system. If you are using ((<Gdk::RGB>)), there is another colormap that is important - the colormap in which ((<Gdk::RGB>)) works, retrieved with Gdk::RGB.colormap. However, when using ((<Gdk::RGB>)), it is not generally necessary to allocate colors directly. == Object Hierarchy * Object * GLib::Instantiatable * GLib::Object * Gdk::Colormap == Class Methods --- Gdk::Colormap.new(visual, allocate) Creates a new colormap for the given visual. * visual: a Gdk::Visual. * allocate: if true, the newly created colormap will be a private colormap, and all colors in it will be allocated for the applications use. * Returns: the new Gdk::Colormap. --- Gdk::Colormap.system Returns the system's default colormap. * Returns: the default colormap(Gdk::Colormap). == Instance Methods --- alloc_color(color, writeable, best_match) Allocates a single color from a colormap. * color: the color to allocate. On return the pixel field will be filled in if allocation succeeds. * writeable: If true, the color is allocated writeable. 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. --- free_color(color) Frees a previously allocated color. * color: the color(Gdk::Color) to free. * Returns: self --- query_color(pixel) Locates the RGB color in colormap corresponding to the given hardware pixel. pixel must be a valid pixel in the colormap; it's a programmer error to call this methodwith a pixel which is not in the colormap. Hardware pixels are normally obtained from Gdk::Colormap#alloc_color, 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 method is rarely useful, it's used for example to implement the eyedropper feature in Gtk::ColorSelection. * pixel: pixel value in hardware display format * Returns: Gdk::Color with red, green, blue fields initialized --- visual Returns the visual for which a given colormap was created. * Returns: the Gdk::Visual of the colormap. --- colors Returns an Array containing the current values(Gdk::Color) in the colormap. * Returns: self == See Also Gdk::Color - ((<Masao>))