Interface ColorChooser
- All Superinterfaces:
Proxy
- All Known Implementing Classes:
ColorButton
,ColorChooser.ColorChooserImpl
,ColorChooserDialog
,ColorChooserWidget
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
ColorChooserWidget
, ColorChooserDialog
and
ColorButton
.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
ColorChooser.Builder<B extends Builder<B>>
Deprecated.static interface
Deprecated.static class
Deprecated.The ColorChooserImpl type represents a native instance of the ColorChooser interface.static class
Deprecated. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
addPalette
(Orientation orientation, int colorsPerLine, @Nullable RGBA[] colors) Deprecated.default void
emitColorActivated
(RGBA color) Deprecated.default void
Deprecated.UseColorDialog
insteadstatic Type
getType()
Deprecated.Get the GType of the ColorChooser classdefault boolean
Deprecated.UseColorDialog
insteadDeprecated.default void
Deprecated.UseColorDialog
insteaddefault void
setUseAlpha
(boolean useAlpha) Deprecated.UseColorDialog
instead
-
Method Details
-
getType
-
addPalette
@Deprecated default void addPalette(Orientation orientation, int colorsPerLine, @Nullable @Nullable RGBA[] colors) Deprecated.UseColorDialog
insteadAdds a palette to the color chooser.If
orientation
is horizontal, the colors are grouped in rows, withcolorsPerLine
colors in each row. Ifhorizontal
isfalse
, the colors are grouped in columns instead.The default color palette of
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
isnull
, removes all previously added palettes.- Parameters:
orientation
-Orientation.HORIZONTAL
if the palette should be displayed in rows,Orientation.VERTICAL
for columnscolorsPerLine
- the number of colors to show in each row/columncolors
- the colors of the palette
-
getRgba
Deprecated.UseColorDialog
insteadGets the currently-selected color.- Parameters:
color
- aGdkRGBA
to fill in with the current color
-
getUseAlpha
Deprecated.UseColorDialog
insteadReturns whether the color chooser shows the alpha channel.- Returns:
true
if the color chooser uses the alpha channel,false
if not
-
setRgba
-
setUseAlpha
Deprecated.UseColorDialog
insteadSets whether or not the color chooser should use the alpha channel.- Parameters:
useAlpha
-true
if color chooser should use alpha channel,false
if not
-
onColorActivated
@Deprecated default SignalConnection<ColorChooser.ColorActivatedCallback> onColorActivated(ColorChooser.ColorActivatedCallback handler) Deprecated.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:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitColorActivated
Deprecated.Emits the "color-activated" signal. SeeonColorActivated(org.gnome.gtk.ColorChooser.ColorActivatedCallback)
.
-
ColorDialog
instead