## GimpColorSelector

GimpColorSelector — Pluggable GIMP color selector modules.

## Functions

GtkWidget * | gimp_color_selector_new ()
void | gimp_color_selector_set_toggles_visible ()
gboolean | gimp_color_selector_get_toggles_visible ()
void | gimp_color_selector_set_toggles_sensitive ()
gboolean | gimp_color_selector_get_toggles_sensitive ()
void | gimp_color_selector_set_show_alpha ()
gboolean | gimp_color_selector_get_show_alpha ()
void | gimp_color_selector_set_color ()
void | gimp_color_selector_get_color ()
void | gimp_color_selector_set_channel ()
GimpColorSelectorChannel | gimp_color_selector_get_channel ()
void | gimp_color_selector_color_changed ()
void | gimp_color_selector_channel_changed ()
void | gimp_color_selector_set_config ()

## Signals

void | channel-changed | Run First
void | color-changed | Run First
void | model-visible-changed | Run First

## Types and Values

| GimpColorSelector
#define | GIMP_COLOR_SELECTOR_SIZE
#define | GIMP_COLOR_SELECTOR_BAR_SIZE
enum | GimpColorSelectorChannel

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkObject
                ╰── GtkWidget
                    ╰── GtkContainer
                        ╰── GtkBox
                            ╰── GimpColorSelector
                                ├── GimpColorNotebook
                                ├── GimpColorScales
                                ╰── GimpColorSelect

## Implemented Interfaces

GimpColorSelector implements AtkImplementorIface, GtkBuildable and GtkOrientable.

## Description

Functions and definitions for creating pluggable GIMP color selector modules.

## Functions

### gimp_color_selector_new ()

    GtkWidget *
    gimp_color_selector_new (GType selector_type,
                             const GimpRGB *rgb,
                             const GimpHSV *hsv,
                             GimpColorSelectorChannel channel);

Creates a new GimpColorSelector widget of type `selector_type` .

Note that this is mostly internal API to be used by other widgets.

Please use `gimp_color_selection_new()` for the "GIMP-typical" color selection widget. Also see `gimp_color_button_new()`.

Retunn value: the new GimpColorSelector widget.

#### Parameters

selector_type | The GType of the selector to create. |
rgb | The initial color to be edited. |
hsv | The same color in HSV. |
channel | The selector's initial channel. |

### gimp_color_selector_set_toggles_visible ()

    void
    gimp_color_selector_set_toggles_visible
                                   (GimpColorSelector *selector,
                                    gboolean visible);

Sets the `visible` property of the `selector` 's toggles.

This function has no effect if this `selector` instance has no toggles to switch channels.

#### Parameters

selector | A GimpColorSelector widget. |
visible | The new `visible` setting. |

### gimp_color_selector_get_toggles_visible ()

    gboolean
    gimp_color_selector_get_toggles_visible
                                   (GimpColorSelector *selector);

Returns the `visible` property of the `selector` 's toggles.

#### Parameters

selector | A GimpColorSelector widget. |

#### Returns

TRUE if the GimpColorSelector's toggles are visible.

Since: 2.10

### gimp_color_selector_set_toggles_sensitive ()

    void
    gimp_color_selector_set_toggles_sensitive
                                   (GimpColorSelector *selector,
                                    gboolean sensitive);

Sets the `sensitive` property of the `selector` 's toggles.

This function has no effect if this `selector` instance has no toggles to switch channels.

#### Parameters

selector | A GimpColorSelector widget. |
sensitive | The new `sensitive` setting. |

### gimp_color_selector_get_toggles_sensitive ()

    gboolean
    gimp_color_selector_get_toggles_sensitive
                                   (GimpColorSelector *selector);

Returns the `sensitive` property of the `selector` 's toggles.

#### Parameters

selector | A GimpColorSelector widget. |

#### Returns

TRUE if the GimpColorSelector's toggles are sensitive.

Since: 2.10

### gimp_color_selector_set_show_alpha ()

    void
    gimp_color_selector_set_show_alpha (GimpColorSelector *selector,
                                        gboolean show_alpha);

Sets the `show_alpha` property of the `selector` widget.

#### Parameters

selector | A GimpColorSelector widget. |
show_alpha | The new `show_alpha` setting. |

### gimp_color_selector_get_show_alpha ()

    gboolean
    gimp_color_selector_get_show_alpha (GimpColorSelector *selector);

Returns the `selector` 's `show_alpha` property.

#### Parameters

selector | A GimpColorSelector widget. |

#### Returns

TRUE if the GimpColorSelector has alpha controls.

Since: 2.10

### gimp_color_selector_set_color ()

    void
    gimp_color_selector_set_color (GimpColorSelector *selector,
                                   const GimpRGB *rgb,
                                   const GimpHSV *hsv);

Sets the color shown in the `selector` widget.

#### Parameters

selector | A GimpColorSelector widget. |
rgb | The new color. |
hsv | The same color in HSV. |

### gimp_color_selector_get_color ()

    void
    gimp_color_selector_get_color (GimpColorSelector *selector,
                                   GimpRGB *rgb,
                                   GimpHSV *hsv);

Retrieves the color shown in the `selector` widget.

#### Parameters

selector | A GimpColorSelector widget. |
rgb | Return location for the color. |
hsv | Return location for the same same color in HSV. |

Since: 2.10

### gimp_color_selector_set_channel ()

    void
    gimp_color_selector_set_channel (GimpColorSelector *selector,
                                     GimpColorSelectorChannel channel);

Sets the `channel` property of the `selector` widget.

Changes between displayed channels if this `selector` instance has the ability to show different channels. This will also update the color model if needed.

#### Parameters

selector | A GimpColorSelector widget. |
channel | The new `channel` setting. |

### gimp_color_selector_get_channel ()

    GimpColorSelectorChannel
    gimp_color_selector_get_channel (GimpColorSelector *selector);

Returns the `selector` 's current channel.

#### Parameters

selector | A GimpColorSelector widget. |

#### Returns

The GimpColorSelectorChannel currently shown by the `selector` .

Since: 2.10

### gimp_color_selector_color_changed ()

    void
    gimp_color_selector_color_changed (GimpColorSelector *selector);

Emits the "color-changed" signal.

#### Parameters

selector | A GimpColorSelector widget. |

### gimp_color_selector_channel_changed ()

    void
    gimp_color_selector_channel_changed (GimpColorSelector *selector);

Emits the "channel-changed" signal.

#### Parameters

selector | A GimpColorSelector widget. |

### gimp_color_selector_set_config ()

    void
    gimp_color_selector_set_config (GimpColorSelector *selector,
                                    GimpColorConfig *config);

Sets the color management configuration to use with this color selector.

#### Parameters

selector | a GimpColorSelector widget. |
config | a GimpColorConfig object. |

Since: 2.4

## Types and Values

### GimpColorSelector

    typedef struct _GimpColorSelector GimpColorSelector;

### GIMP_COLOR_SELECTOR_SIZE

    #define GIMP_COLOR_SELECTOR_SIZE     150

The suggested size for a color area in a GimpColorSelector implementation.

### GIMP_COLOR_SELECTOR_BAR_SIZE

    #define GIMP_COLOR_SELECTOR_BAR_SIZE 15

The suggested width for a color bar in a GimpColorSelector implementation.

### enum GimpColorSelectorChannel

An enum to specify the types of color channels edited in GimpColorSelector widgets.

#### Members

GIMP_COLOR_SELECTOR_HUE | the hue channel |
GIMP_COLOR_SELECTOR_SATURATION | the saturation channel |
GIMP_COLOR_SELECTOR_VALUE | the value channel |
GIMP_COLOR_SELECTOR_RED | the red channel |
GIMP_COLOR_SELECTOR_GREEN | the green channel |
GIMP_COLOR_SELECTOR_BLUE | the blue channel |
GIMP_COLOR_SELECTOR_ALPHA | the alpha channel |
GIMP_COLOR_SELECTOR_LCH_LIGHTNESS | the lightness channel |
GIMP_COLOR_SELECTOR_LCH_CHROMA | the chroma channel |
GIMP_COLOR_SELECTOR_LCH_HUE | the hue channel |

## Signal Details

### The `“channel-changed”` signal

    void
    user_function (GimpColorSelector       *gimpcolorselector,
                   GimpColorSelectorChannel arg1,
                   gpointer                 user_data)

Flags: Run First

### The `“color-changed”` signal

    void
    user_function (GimpColorSelector *gimpcolorselector,
                   gpointer           arg1,
                   gpointer           arg2,
                   gpointer           user_data)

Flags: Run First

### The `“model-visible-changed”` signal

    void
    user_function (GimpColorSelector     *gimpcolorselector,
                   GimpColorSelectorModel arg1,
                   gboolean               arg2,
                   gpointer               user_data)

Flags: Run First

## See Also

GModule, GTypeModule, GimpModule