Top | ![]() |
![]() |
![]() |
![]() |
void | gtk_color_chooser_get_rgba () |
void | gtk_color_chooser_set_rgba () |
gboolean | gtk_color_chooser_get_use_alpha () |
void | gtk_color_chooser_set_use_alpha () |
void | gtk_color_chooser_add_palette () |
GtkColorChooser is an interface that is implemented by widgets for choosing colors. Depending on the situation, colors may be allowed to have alpha (translucency).
In GTK+, the main widgets that implement this interface are GtkColorChooserWidget, GtkColorChooserDialog and GtkColorButton.
void gtk_color_chooser_get_rgba (GtkColorChooser *chooser
,GdkRGBA *color
);
Gets the currently-selected color.
Since: 3.4
void gtk_color_chooser_set_rgba (GtkColorChooser *chooser
,const GdkRGBA *color
);
Sets the color.
Since: 3.4
gboolean
gtk_color_chooser_get_use_alpha (GtkColorChooser *chooser
);
Returns whether the color chooser shows the alpha channel.
Since: 3.4
void gtk_color_chooser_set_use_alpha (GtkColorChooser *chooser
,gboolean use_alpha
);
Sets whether or not the color chooser should use the alpha channel.
Since: 3.4
void gtk_color_chooser_add_palette (GtkColorChooser *chooser
,GtkOrientation orientation
,gint colors_per_line
,gint n_colors
,GdkRGBA *colors
);
Adds a palette to the color chooser. If orientation
is horizontal,
the colors are grouped in rows, with colors_per_line
colors
in each row. If horizontal
is FALSE
, the colors are grouped
in columns instead.
The default color palette of GtkColorChooserWidget has 27 colors, organized in columns of 3 colors. The default gray palette has 9 grays in a single row.
The layout of the color chooser widget works best when the palettes have 9-10 columns.
Calling this function for the first time has the side effect of removing the default color and gray palettes from the color chooser.
If colors
is NULL
, removes all previously added palettes.
chooser |
||
orientation |
|
|
colors_per_line |
the number of colors to show in each row/column |
|
n_colors |
the total number of elements in |
|
colors |
the colors of the palette, or |
[allow-none][array length=n_colors] |
Since: 3.4