gimppalette

gimppalette — Functions operating on a single palette.

Functions

Description

Functions operating on a single palette.

Functions

gimp_palette_new ()

gchar *
gimp_palette_new (const gchar *name);

Creates a new palette

This procedure creates a new, uninitialized palette

Parameters

name

The requested name of the new palette.

 

Returns

The actual new palette name. The returned value must be freed with g_free().

[transfer full]

Since: 2.2


gimp_palette_duplicate ()

gchar *
gimp_palette_duplicate (const gchar *name);

Duplicates a palette

This procedure creates an identical palette by a different name

Parameters

name

The palette name.

 

Returns

The name of the palette's copy. The returned value must be freed with g_free().

[transfer full]

Since: 2.2


gimp_palette_rename ()

gchar *
gimp_palette_rename (const gchar *name,
                     const gchar *new_name);

Rename a palette

This procedure renames a palette

Parameters

name

The palette name.

 

new_name

The new name of the palette.

 

Returns

The actual new name of the palette. The returned value must be freed with g_free().

[transfer full]

Since: 2.2


gimp_palette_delete ()

gboolean
gimp_palette_delete (const gchar *name);

Deletes a palette

This procedure deletes a palette

Parameters

name

The palette name.

 

Returns

TRUE on success.

Since: 2.2


gimp_palette_get_info ()

gboolean
gimp_palette_get_info (const gchar *name,
                       gint *num_colors);

Retrieve information about the specified palette.

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

Parameters

name

The palette name.

 

num_colors

The number of colors in the palette.

[out]

Returns

TRUE on success.

Since: 2.2


gimp_palette_get_colors ()

GimpRGB *
gimp_palette_get_colors (const gchar *name,
                         gint *num_colors);

Gets all colors from the specified palette.

This procedure retrieves all color entries of the specified palette.

Parameters

name

The palette name.

 

num_colors

Length of the colors array.

[out]

Returns

The colors in the palette. The returned value must be freed with g_free().

[array length=num_colors][element-type GimpRGB][transfer full]

Since: 2.6


gimp_palette_get_columns ()

gint
gimp_palette_get_columns (const gchar *name);

Retrieves the number of columns to use to display this palette

This procedures retrieves the preferred number of columns to use when the palette is being displayed.

Parameters

name

The palette name.

 

Returns

The number of columns used to display this palette.

Since: 2.4


gimp_palette_set_columns ()

gboolean
gimp_palette_set_columns (const gchar *name,
                          gint columns);

Sets the number of columns to use when displaying the palette

This procedures controls how many colors are shown per row when the palette is being displayed. This value can only be changed if the palette is writable. The maximum allowed value is 64.

Parameters

name

The palette name.

 

columns

The new number of columns.

 

Returns

TRUE on success.

Since: 2.4


gimp_palette_add_entry ()

gboolean
gimp_palette_add_entry (const gchar *name,
                        const gchar *entry_name,
                        const GimpRGB *color,
                        gint *entry_num);

Adds a palette entry to the specified palette.

This procedure adds an entry to the specified palette. It returns an error if the entry palette does not exist.

Parameters

name

The palette name.

 

entry_name

The name of the entry.

 

color

The new entry's color color.

 

entry_num

The index of the added entry.

[out]

Returns

TRUE on success.

Since: 2.2


gimp_palette_delete_entry ()

gboolean
gimp_palette_delete_entry (const gchar *name,
                           gint entry_num);

Deletes a palette entry from the specified palette.

This procedure deletes an entry from the specified palette. It returns an error if the entry palette does not exist.

Parameters

name

The palette name.

 

entry_num

The index of the added entry.

 

Returns

TRUE on success.

Since: 2.2


gimp_palette_entry_get_color ()

gboolean
gimp_palette_entry_get_color (const gchar *name,
                              gint entry_num,
                              GimpRGB *color);

Gets the specified palette entry from the specified palette.

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

Parameters

name

The palette name.

 

entry_num

The entry to retrieve.

 

color

The color requested.

[out caller-allocates]

Returns

TRUE on success.

Since: 2.2


gimp_palette_entry_set_color ()

gboolean
gimp_palette_entry_set_color (const gchar *name,
                              gint entry_num,
                              const GimpRGB *color);

Sets the specified palette entry in the specified palette.

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

Parameters

name

The palette name.

 

entry_num

The entry to retrieve.

 

color

The new color.

 

Returns

TRUE on success.

Since: 2.2


gimp_palette_entry_get_name ()

gboolean
gimp_palette_entry_get_name (const gchar *name,
                             gint entry_num,
                             gchar **entry_name);

Gets the specified palette entry from the specified palette.

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

Parameters

name

The palette name.

 

entry_num

The entry to retrieve.

 

entry_name

The name requested.

[out][transfer full]

Returns

TRUE on success.

Since: 2.2


gimp_palette_entry_set_name ()

gboolean
gimp_palette_entry_set_name (const gchar *name,
                             gint entry_num,
                             const gchar *entry_name);

Sets the specified palette entry in the specified palette.

This procedure sets the name of the zero-based entry specified for the specified palette. It returns an error if the entry does not exist.

Parameters

name

The palette name.

 

entry_num

The entry to retrieve.

 

entry_name

The new name.

 

Returns

TRUE on success.

Since: 2.2


gimp_palette_is_editable ()

gboolean
gimp_palette_is_editable (const gchar *name);

Tests if palette can be edited

Returns TRUE if you have permission to change the palette

Parameters

name

The palette name.

 

Returns

TRUE if the palette can be edited.

Since: 2.4

Types and Values