type Gdk_Color is private;
subtype Gdk_Colormap is Gdk.Gdk_Colormap;
type Property_Gdk_Color is new Glib.Property;
Null_Color : constant Gdk_Color;
Null_Colormap : constant Gdk_Colormap;
function Gdk_Color_Type return Glib.GType;
function Gdk_Colormap_Type return Glib.GType;
procedure Gdk_New
( | Colormap | : out Gdk_Colormap; |
Visual | : Gdk.Visual.Gdk_Visual; | |
Private_Cmap | : Boolean); |
procedure Unref
( | Colormap | : Gdk_Colormap); |
procedure Change
( | Colormap | : Gdk_Colormap; |
Ncolors | : Gint); |
procedure Alloc_Colors
( | Colormap | : Gdk_Colormap; |
Colors | : in out Gdk_Color_Array; | |
Writeable | : Boolean := False; | |
Best_Match | : Boolean := True; | |
Success | : out Boolean_Array; | |
Result | : out Gint); |
procedure Alloc_Color
( | Colormap | : Gdk_Colormap; |
Color | : in out Gdk_Color; | |
Writeable | : Boolean := False; | |
Best_Match | : Boolean := True; | |
Success | : out Boolean); |
procedure Free_Colors
( | Colormap | : Gdk_Colormap; |
Colors | : Gdk_Color_Array); |
procedure Get_Visual
( | Colormap | : Gdk_Colormap; |
Visual | : out Gdk.Visual.Gdk_Visual); |
function Parse
( | Spec | : String) return Gdk_Color; |
function Equal
( | Colora, Colorb | : Gdk_Color) return Boolean; |
procedure Store
( | Colormap | : Gdk_Colormap; |
Colors | : Gdk_Color_Array); |
procedure Alloc
( | Colormap | : Gdk_Colormap; |
Contiguous | : Boolean; | |
Planes | : Gulong_Array; | |
Pixels | : Gulong_Array; | |
Succeeded | : out Boolean); |
procedure Free
( | Colormap | : Gdk_Colormap; |
Pixels | : Gulong_Array; | |
Planes | : Gulong); |
function White
( | Colormap | : Gdk_Colormap) return Gdk_Color; |
function Black
( | Colormap | : Gdk_Colormap) return Gdk_Color; |
procedure Alloc
( | Colormap | : Gdk_Colormap; |
Color | : in out Gdk_Color); |
procedure Change
( | Colormap | : Gdk_Colormap; |
Color | : in out Gdk_Color; | |
Succeeded | : out Boolean); |
function To_String
( | Color | : Gdk_Color) return String; |
procedure Set_Property
( | Object | : access Glib.Object.GObject_Record'Class; |
Name | : Property_Gdk_Color; | |
Value | : Gdk_Color); |
function Get_Property
( | Object | : access Glib.Object.GObject_Record'Class; |
Name | : Property_Gdk_Color) return Gdk_Color; |
procedure Set_Value
( | Value | : out Glib.Values.GValue; |
Val | : Gdk_Color); |
function Get_Value
( | Value | : Glib.Values.GValue) return Gdk_Color; |
This package provides an interface to the color handling facilities in gtk+. It is able to handle any kind of visual (monochrome, greyscale, color with different depths, ...), but provides a common and easy interface for all of them.
Some of these functions expect a Colormap. There are two ways you can get such a colormap, either a system default colormap or a per-widget colormap. It is recommended, unless you are writing your own new widget, to always use the system default Colormap. All the functions to get these colormaps are found in Gtk.Widget.
Getting the Red/Green/Blue components can be done through Parse, and is actually recommended, since the exact color generally depends on the visual your application is running on.
Note for users transitioning from gtk+ 1.2: the Get_System call is now obsolete, and you should use Gtk.Widget.Get_Default_Colormap instead.
Binding from C File version 1.3.6