add_palette


Description:

public abstract void add_palette (Orientation orientation, int colors_per_line, RGBA[]? colors)

Adds a palette to the color chooser.

Note:

Use [class@Gtk.ColorDialog] instead

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 [class@Gtk.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:

this

a `GtkColorChooser`

orientation

gtk_orientation_horizontal if the palette should be displayed in rows, gtk_orientation_vertical for columns

colors_per_line

the number of colors to show in each row/column

colors

the colors of the palette

n_colors

the total number of elements in colors