GwyGradientSwatch

GwyGradientSwatch — A swatch displaying a colour

Functions

Properties

GwyGradient * gradient Read / Write
gboolean use-alpha Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GwyGradientSwatch

Implemented Interfaces

GwyGradientSwatch implements AtkImplementorIface and GtkBuildable.

Includes

#include <libgwydgets/gwydgets.h>

Description

The widget is a simple rectangle displaying a colour gradient, with some support for visualisation of the alpha value.

Functions

gwy_gradient_swatch_new()

GtkWidget *
gwy_gradient_swatch_new (void);

Creates a new color swatch.

Returns

A new color swatch.


gwy_gradient_swatch_set_gradient()

void
gwy_gradient_swatch_set_gradient (GwyGradientSwatch *swatch,
                                  GwyGradient *gradient);

Sets the current gradient of a gradient swatch.

The gradient can be NULL. The default gradient is then displayed, although it is not terribly useful.

Parameters

swatch

A gradient swatch.

 

gradient

The gradient to display.

 

gwy_gradient_swatch_get_gradient()

GwyGradient *
gwy_gradient_swatch_get_gradient (GwyGradientSwatch *swatch);

Obtains the current gradient displayed by a gradient swatch.

Parameters

swatch

A gradient swatch.

 

Returns

The displayed gradient.


gwy_gradient_swatch_set_use_alpha()

void
gwy_gradient_swatch_set_use_alpha (GwyGradientSwatch *swatch,
                                   gboolean use_alpha);

Sets whether the gradient swatch should use the alpha channel.

Parameters

swatch

A gradient swatch.

 

use_alpha

TRUE if gradient swatch should visualise the alpha channel, FALSE to ignore it.

 

gwy_gradient_swatch_get_use_alpha()

gboolean
gwy_gradient_swatch_get_use_alpha (GwyGradientSwatch *swatch);

Reports whether the gradient swatch uses the alpha channel.

Parameters

swatch

A gradient swatch.

 

Returns

TRUE if the gradient swatch visualises alpha channel, FALSE if it ignores it.

Types and Values

struct GwyGradientSwatch

struct GwyGradientSwatch;

struct GwyGradientSwatchClass

struct GwyGradientSwatchClass {
    GtkWidgetClass parent_class;

    void (*reserved1)(void);
    void (*reserved2)(void);
};

GwyGradientSwatchPrivate

typedef struct _GwyGradientSwatchPrivate GwyGradientSwatchPrivate;

Property Details

The “gradient” property

  “gradient”                 GwyGradient *

Color gradient to display.

Owner: GwyGradientSwatch

Flags: Read / Write


The “use-alpha” property

  “use-alpha”                gboolean

Whether to display the color with an alpha value.

Owner: GwyGradientSwatch

Flags: Read / Write

Default value: FALSE