GwyColorButton: Gwyddion Widgets Library Reference Manual

## GwyColorButton GwyColorButton — A colour displaying button |

## Functions

GtkWidget * | gwy_color_button_new ()
void | gwy_color_button_set_color ()
void | gwy_color_button_get_color ()
void | gwy_color_button_set_use_alpha ()
gboolean | gwy_color_button_get_use_alpha ()

## Types and Values

struct | GwyColorButton
struct | GwyColorButtonClass

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBin
                        ╰── GtkButton
                            ╰── GwyColorButton

## Implemented Interfaces

GwyColorButton implements AtkImplementorIface, GtkBuildable, GtkActionable and GtkActivatable.

## Includes

    #include <libgwyui/gwyui.h>

## Description

A button which displays a colour swatch.

It does not have its own color selection dialog however, it is just an ordinary button displaying a colour. You need to connect some callback to its "clicked" signal. Also it uses GwyRGBA for colour representation.

This widget is just a thin convenience wrapper to construct a button with a GwyColorSwatch inside. It is kept mainly for compatiblitity.

## Functions

### gwy_color_button_new()

    GtkWidget *
    gwy_color_button_new (void);

Creates a new colour button.

The button contains a swatch representing the current selected colour.

The button child must not be changed.

#### Returns

A new colour button.

### gwy_color_button_set_color()

    void
    gwy_color_button_set_color (GwyColorButton *button,
                                const GwyRGBA *color);

Sets the current color of a colour button.

#### Parameters

button | A colour button. |
color | The new colour as GwyRGBA. |

### gwy_color_button_get_color()

    void
    gwy_color_button_get_color (GwyColorButton *button,
                                GwyRGBA *color);

Obtains the current colour of a colour button.

#### Parameters

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

### gwy_color_button_set_use_alpha()

    void
    gwy_color_button_set_use_alpha (GwyColorButton *button,
                                    gboolean use_alpha);

Sets whether or not the color button should use the alpha channel.

#### Parameters

button | A colour button. |
use_alpha | `TRUE` if colour swatch should visualise the alpha channel, `FALSE` to ignore it. |

### gwy_color_button_get_use_alpha()

    gboolean
    gwy_color_button_get_use_alpha (GwyColorButton *button);

Reports whether the colour button uses the alpha channel.

#### Parameters

button | A colour button. |

## Types and Values

### struct GwyColorButton

    struct GwyColorButton;

### struct GwyColorButtonClass

    struct GwyColorButtonClass {
        GtkButtonClass parent_class;
    };