_
SelectionA Gtk_Color_Selection widget is a complex dialog that allows the user to select a color based either on its (Red, Green, Blue) or its (Hue, Saturation, Value). An additional field is provided to select the opacity of the color (this is usually called the alpha channel).
see section Package Gtk.Color_
Selection_
Dialog for a version of this widget
that comes with its own dialog.
see section Package Gtk.Extra.Color_
Combo for a different way to select colors.
Widget Hierarchy |
---|
Gtk_Object (see section Package Gtk.Object)
\___ Gtk_Widget (see section Package Gtk.Widget)
\___ Gtk_Container (see section Package Gtk.Container)
\___ Gtk_Box (see section Package Gtk.Box)
\___ Gtk_Color_Selection (see section Package Gtk.Color
|
Types |
---|
type Color_Array is array (Color_Index'Range) of Gdouble; | |
Array that indicates the currently selected color.
All the values are between 0.0 and 1.0 (a percentage value).
They should be converted to absolute values before using them to create
a new color, with the following piece of code:
Absolute := To_Absolute (Color_Array (Index))
| |
type Color_Index is (Red, Green, Blue, Opacity); | |
Used as an index to the table used to set and get the currently
selected color.
|
Subprograms |
---|
procedure Gtk_New (Widget : out Gtk_Color_Selection); | ||
Create a new color selection widget.
| ||
function Get_Type return Gtk.Gtk_Type; | ||
Return the internal value associated with a Gtk_Color_Selection.
| ||
procedure Set_Update_Policy (Colorsel : access Gtk_Color_Selection_Record; Policy : in Enums.Gtk_Update_Type); | ||
Set the behavior of the scales used to select a value (red, green,...) | ||
procedure Set_Opacity (Colorsel : access Gtk_Color_Selection_Record; Use_Opacity : in Boolean); | ||
Indicate whether the dialog should provide a way to change the | ||
procedure Set_Color (Colorsel : access Gtk_Color_Selection_Record; Color : in Color_Array); | ||
Modify the current color. | ||
procedure Get_Color (Colorsel : access Gtk_Color_Selection_Record; Color : out Color_Array); | ||
Get the current color. | ||
function To_Absolute (Color : Gdouble) return Gushort; | ||
Convert from a percentage value as returned by Get_Color to an | ||
function To_Percent (Color : Gushort) return Gdouble; | ||
Convert from an absolute value as used in Gdk_Color to a percentage |