Interface ColorChooser
- All Superinterfaces:
Proxy
- All Known Implementing Classes:
ColorButton,ColorChooser.ColorChooser$Impl,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
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceColorChooser.Builder<B extends Builder<B>>Deprecated.static interfaceDeprecated.static classDeprecated.The ColorChooser$Impl type represents a native instance of the ColorChooser interface.static classDeprecated. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddPalette(Orientation orientation, int colorsPerLine, @Nullable RGBA @Nullable [] colors) Deprecated.UseColorDialoginsteaddefault voidemitColorActivated(@Nullable RGBA color) Deprecated.default voidDeprecated.UseColorDialoginsteadstatic @Nullable TypegetType()Deprecated.Get the GType of the ColorChooser classdefault booleanDeprecated.UseColorDialoginsteadDeprecated.default voidDeprecated.UseColorDialoginsteaddefault voidsetUseAlpha(boolean useAlpha) Deprecated.UseColorDialoginstead
-
Method Details
-
getType
Deprecated.Get the GType of the ColorChooser class- Returns:
- the GType
-
addPalette
@Deprecated default void addPalette(Orientation orientation, int colorsPerLine, @Nullable RGBA @Nullable [] colors) Deprecated.UseColorDialoginsteadAdds a palette to the color chooser.If
orientationis horizontal, the colors are grouped in rows, withcolorsPerLinecolors in each row. Ifhorizontalisfalse, the colors are grouped in columns instead.The default color palette of
ColorChooserWidgethas 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
colorsisnull, removes all previously added palettes.- Parameters:
orientation-Orientation.HORIZONTALif the palette should be displayed in rows,Orientation.VERTICALfor columnscolorsPerLine- the number of colors to show in each row/columncolors- the colors of the palette
-
getRgba
Deprecated.UseColorDialoginsteadGets the currently-selected color.- Parameters:
color- aGdkRGBAto fill in with the current color
-
getUseAlpha
Deprecated.UseColorDialoginsteadReturns whether the color chooser shows the alpha channel.- Returns:
trueif the color chooser uses the alpha channel,falseif not
-
setRgba
-
setUseAlpha
Deprecated.UseColorDialoginsteadSets whether or not the color chooser should use the alpha channel.- Parameters:
useAlpha-trueif color chooser should use alpha channel,falseif 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).
-
ColorDialogandColorDialogButtoninstead of widgets implementingGtkColorChooser