as a #GdkRGBA struct. The property can be set to change the current selection programmatically.
gtk.color_chooser_mixin
Module for [ColorChooser] interface mixin
Templates 2
#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.
Get rgba property.
Returns
Set rgba property.
Parameters
propval | The ::rgba property contains the currently selected color, as a #GdkRGBA struct. The property can be set to change the current selection programmatically. |
Get useAlpha property.
Returns
information. When it is false, the #GdkRGBA struct obtained via the #GtkColorChooser:rgba property will be forced to have alpha == 1.
Implementations are expected to show alpha by rendering the color over a non-uniform background (like a checkerboard pattern).
Set useAlpha property.
Parameters
propval | When ::use-alpha is true, colors may have alpha (translucency) information. When it is false, the #GdkRGBA struct obtained via the #GtkColorChooser:rgba property will be forced to have |
alpha | = 1. Implementations are expected to show alpha by rendering the color over a non-uniform background (like a checkerboard pattern). |
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.
Parameters
orientation | [gtk.types.Orientation.Horizontal] if the palette should be displayed in rows, [gtk.types.Orientation.Vertical] for columns |
colorsPerLine | the number of colors to show in each row/column |
colors | the colors of the palette, or null |
Gets the currently-selected color.
Parameters
color | a #GdkRGBA to fill in with the current color |
Returns whether the color chooser shows the alpha channel.
Returns
false if not
Sets the color.
Parameters
color | the new color |
Sets whether or not the color chooser should use the alpha channel.
Parameters
useAlpha | true if color chooser should use alpha channel, false if not |
Connect to ColorActivated signal.
Emitted when a color is activated from the color chooser. This usually happens when the user clicks a color swatch, or a color is selected and the user presses one of the keys Space, Shift+Space, Return or Enter.
Parameters
callback | signal callback delegate or function to connect void callback(gdk.rgba.RGBA color, gtk.color_chooser.ColorChooser colorChooser) color the color (optional) colorChooser the instance the signal is connected to (optional) |
after | Yes.After to execute callback after default handler, No.After to execute before (default) |
Returns
Set rgba property.
Parameters
propval | The ::rgba property contains the currently selected color, as a #GdkRGBA struct. The property can be set to change the current selection programmatically. |
Returns
Set useAlpha property.
Parameters
propval | When ::use-alpha is true, colors may have alpha (translucency) information. When it is false, the #GdkRGBA struct obtained via the #GtkColorChooser:rgba property will be forced to have |
alpha | = 1. Implementations are expected to show alpha by rendering the color over a non-uniform background (like a checkerboard pattern). |