instead of widgets implementing [gtk.color_chooser.ColorChooser]
gtk.color_chooser_mixin
Module for [ColorChooser] interface mixin
Templates 2
[gtk.color_chooser.ColorChooser] 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 [gtk.color_chooser_widget.ColorChooserWidget], [gtk.color_chooser_dialog.ColorChooserDialog] and [gtk.color_button.ColorButton].
Deprecated
Get rgba property.
Returns
The property can be set to change the current selection programmatically.
Deprecated
instead of widgets implementing [gtk.color_chooser.ColorChooser]
Set rgba property.
Parameters
propval | The currently selected color, as a [gdk.rgba.RGBA] struct. The property can be set to change the current selection programmatically. |
Deprecated
instead of widgets implementing [gtk.color_chooser.ColorChooser]
Get useAlpha property.
Returns
When ::use-alpha is false, the [gdk.rgba.RGBA] struct obtained via the [gtk.color_chooser.ColorChooser.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).
Deprecated
instead of widgets implementing [gtk.color_chooser.ColorChooser]
Set useAlpha property.
Parameters
propval | Whether colors may have alpha (translucency). When ::use-alpha is false, the [gdk.rgba.RGBA] struct obtained via the [gtk.color_chooser.ColorChooser.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). |
Deprecated
instead of widgets implementing [gtk.color_chooser.ColorChooser]
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 [gtk.color_chooser_widget.ColorChooserWidget] has 45 colors, organized in columns of 5 colors (this includes some grays).
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 palette 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 |
Deprecated
Gets the currently-selected color.
Parameters
color | a [gdk.rgba.RGBA] to fill in with the current color |
Deprecated
Returns whether the color chooser shows the alpha channel.
Returns
false if not
Deprecated
Sets the color.
Parameters
color | the new color |
Deprecated
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 |
Deprecated
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
Deprecated
instead of widgets implementing [gtk.color_chooser.ColorChooser]
Set rgba property.
Parameters
propval | The currently selected color, as a [gdk.rgba.RGBA] struct. The property can be set to change the current selection programmatically. |
Returns
Deprecated
instead of widgets implementing [gtk.color_chooser.ColorChooser]
Set useAlpha property.
Parameters
propval | Whether colors may have alpha (translucency). When ::use-alpha is false, the [gdk.rgba.RGBA] struct obtained via the [gtk.color_chooser.ColorChooser.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). |
Returns
Deprecated
instead of widgets implementing [gtk.color_chooser.ColorChooser]