### Virtual Method

# Gtk ColorChooser add_palette

deprecated: 4.10

#### Declaration [src]

    void
    add_palette (
      GtkColorChooser* chooser,
      GtkOrientation orientation,
      int colors_per_line,
      int n_colors,
      GdkRGBA* colors
    )

#### Description [src]

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 `GtkColorChooserWidget` 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.

Deprecated since: 4.10

Use `GtkColorDialog` instead.

#### Parameters

`orientation`

  Type: `GtkOrientation`

  `GTK_ORIENTATION_HORIZONTAL` if the palette should be displayed in rows, `GTK_ORIENTATION_VERTICAL` for columns.

`colors_per_line`

  Type: `int`

  The number of colors to show in each row/column.

`n_colors`

  Type: `int`

  The total number of elements in `colors`.

`colors`

  Type: An array of `GdkRGBA`

  The colors of the palette.

  The argument can be `NULL`.
  The length of the array is specified in the `n_colors` argument.
  The data is owned by the caller of the method.