Module: Gtk::ColorChooser
- Defined in:
- (unknown)
Overview
Gtk::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::ColorChooserWidget, #GtkColorChooserDialog and #GtkColorButton.
Instance Method Summary collapse
-
#add_palette(orientation, colors_per_line, n_colors, colors) ⇒ nil
Adds a palette to the color chooser.
- #color_activated(color) ⇒ nil
-
#get_rgba(color) ⇒ nil
Gets the currently-selected color.
-
#rgba=(color) ⇒ nil
Sets the color.
-
#use_alpha ⇒ TrueClass
Returns whether the color chooser shows the alpha channel.
-
#use_alpha=(use_alpha) ⇒ nil
Sets whether or not the color chooser should use the alpha channel.
Instance Method Details
#add_palette(orientation, colors_per_line, n_colors, colors) ⇒ nil
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::ColorChooserWidget 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 nil, removes all previously added palettes.
#color_activated(color) ⇒ nil
#get_rgba(color) ⇒ nil
Gets the currently-selected color.
#rgba=(color) ⇒ nil
Sets the color.
#use_alpha ⇒ TrueClass
Returns whether the color chooser shows the alpha channel.
#use_alpha=(use_alpha) ⇒ nil
Sets whether or not the color chooser should use the alpha channel.