## gimppalettes

gimppalettes —

## Synopsis

    gboolean    gimp_palettes_refresh           (void);
    gchar**     gimp_palettes_get_list          (const gchar *filter,
                                                 gint *num_palettes);
    gchar*      gimp_palettes_get_palette       (gint *num_colors);
    gboolean    gimp_palettes_set_palette       (const gchar *name);
    gchar*      gimp_palettes_get_palette_entry (const gchar *name,
                                                 gint entry_num,
                                                 gint *num_colors,
                                                 GimpRGB *color);
    gboolean    gimp_palettes_popup             (const gchar *palette_callback,
                                                 const gchar *popup_title,
                                                 const gchar *initial_palette);
    gboolean    gimp_palettes_close_popup       (const gchar *palette_callback);
    gboolean    gimp_palettes_set_popup         (const gchar *palette_callback,
                                                 const gchar *palette_name);

## Description

## Details

### gimp_palettes_refresh ()

    gboolean    gimp_palettes_refresh           (void);

Refreshes current palettes. This function always succeeds.

This procedure incorporates all palettes currently in the users palette path.

Returns : | TRUE on success.

### gimp_palettes_get_list ()

    gchar**     gimp_palettes_get_list          (const gchar *filter,
                                                 gint *num_palettes);

Retrieves a list of all of the available palettes

This procedure returns a complete listing of available palettes. Each name returned can be used as input to the command 'gimp_palette_set_palette'.

`filter` : | An optional regular expression used to filter the list.
`num_palettes` : | The number of palettes in the list.
Returns : | The list of palette names.

### gimp_palettes_get_palette ()

    gchar*      gimp_palettes_get_palette       (gint *num_colors);

Retrieve information about the currently active palette.

This procedure retrieves information about the currently active palette. This includes the name, and the number of colors.

`num_colors` : | The palette num_colors.
Returns : | The palette name.

### gimp_palettes_set_palette ()

    gboolean    gimp_palettes_set_palette       (const gchar *name);

Set the specified palette as the active palette.

This procedure allows the active palette to be set by specifying its name. The name is simply a string which corresponds to one of the names of the installed palettes. If no matching palette is found, this procedure will return an error. Otherwise, the specified palette becomes active and will be used in all subsequent palette operations.

`name` : | The palette name.
Returns : | TRUE on success.

### gimp_palettes_get_palette_entry ()

    gchar*      gimp_palettes_get_palette_entry (const gchar *name,
                                                 gint entry_num,
                                                 gint *num_colors,
                                                 GimpRGB *color);

Gets the specified palette entry from the currently active palette.

This procedure retrieves the color of the zero-based entry specifed for the current palette. It returns an error if the entry does not exist.

`name` : | the palette name (\"\" means currently active palette).
`entry_num` : | The entry to retrieve.
`num_colors` : | The palette num_colors.
`color` : | The color requested.
Returns : | The palette name.

### gimp_palettes_popup ()

    gboolean    gimp_palettes_popup             (const gchar *palette_callback,
                                                 const gchar *popup_title,
                                                 const gchar *initial_palette);

Invokes the Gimp palette selection.

This procedure popups the palette selection dialog.

`palette_callback` : | The callback PDB proc to call when palette selection is made.
`popup_title` : | Title to give the palette popup window.
`initial_palette` : | The name of the palette to set as the first selected.
Returns : | TRUE on success.

### gimp_palettes_close_popup ()

    gboolean    gimp_palettes_close_popup       (const gchar *palette_callback);

Popdown the Gimp palette selection.

This procedure closes an opened palette selection dialog.

`palette_callback` : | The name of the callback registered for this popup.
Returns : | TRUE on success.

### gimp_palettes_set_popup ()

    gboolean    gimp_palettes_set_popup         (const gchar *palette_callback,
                                                 const gchar *palette_name);

Sets the current palette selection in a popup.

Sets the current palette selection in a popup.

`palette_callback` : | The name of the callback registered for this popup.
`palette_name` : | The name of the palette to set as selected.
Returns : | TRUE on success.