GwyColorWheel: Gwyddion Widgets Library Reference Manual

## GwyColorWheel GwyColorWheel — Colour editing component |

## Functions

GtkWidget * | gwy_color_wheel_new ()
void | gwy_color_wheel_get_color ()
void | gwy_color_wheel_set_color ()
gdouble | gwy_color_wheel_get_hue ()
void | gwy_color_wheel_set_hue ()

## Signals

void | color-changed | Run First

## Types and Values

struct | GwyColorWheel
struct | GwyColorWheelClass

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GwyColorWheel

## Implemented Interfaces

GwyColorWheel implements AtkImplementorIface and GtkBuildable.

## Includes

    #include <libgwyui/gwyui.h>

## Description

GwyColorWheel is an HSV colour selector consiting of a hue ring with a saturation/value triangle inside.

## Functions

### gwy_color_wheel_new()

    GtkWidget *
    gwy_color_wheel_new (void);

Creates a new colour wheel.

The widget takes up all the space allocated for it.

#### Returns

The new wheel widget.

### gwy_color_wheel_get_color()

    void
    gwy_color_wheel_get_color (GwyColorWheel *wheel,
                               GwyRGBA *color);

Obtains the current colour of a colour wheel.

The alpha component is always whatever was last set using `gwy_color_wheel_set_color()` because the colour wheel does not have any means to modify alpha.

#### Parameters

wheel | A colour wheel. |
color | Location to fill in with the current colour. |

### gwy_color_wheel_set_color()

    void
    gwy_color_wheel_set_color (GwyColorWheel *wheel,
                               const GwyRGBA *color);

Sets the current colour of a colour wheel.

The alpha component is preserved but ignored.

#### Parameters

wheel | A colour wheel. |
color | The colour to display as GwyRGBA. |

### gwy_color_wheel_get_hue()

    gdouble
    gwy_color_wheel_get_hue (GwyColorWheel *wheel);

Gets the rotation hue value of a colour wheel.

The rotation hue corresponds to the wheel rotation. It is generally the same as the actual hue, except for completely unsaturated (grey) colours. The hue is undefined and conventionally it is defined as 0. However, the wheel tries to avoid sudden changes of orientation when a colour becomes desaturated. Therefore, it may preserve the orientation corresponding to the last colour which has non-zero saturation.

Use `gwy_color_wheel_get_color()` and `gtk_rgb_to_hsv()` to obtain the conventional hue value. Use this function to obtain the orientation of the wheel if you need it.

#### Parameters

wheel | A colour wheel. |

#### Returns

The hue value in interval [0,1].

### gwy_color_wheel_set_hue()

    void
    gwy_color_wheel_set_hue (GwyColorWheel *wheel,
                             gdouble hue);

Sets the rotation hue value of a colour wheel.

This function is seldom needed. See `gwy_color_wheel_get_hue()` for discussion.

#### Parameters

wheel | A colour wheel. |
hue | New hue value in interval [0,1]. |

## Types and Values

### struct GwyColorWheel

    struct GwyColorWheel;

### struct GwyColorWheelClass

    struct GwyColorWheelClass {
        GtkWidgetClass parent_class;

        void (*color_changed)(GwyColorWheel *wheel);
    };

## Signal Details

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

    void
    user_function (GwyColorWheel *gwywheel,
                   gpointer       user_data)

The ::color-changed signal is emitted when the color changes.

#### Parameters

gwywheel | The GwyColorWheel which received the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Run First