CtkHSV

CtkHSV — A “color wheel” widget

Functions

Signals

void changed Run First
void move Action

Types and Values

struct CtkHSV

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── CtkWidget
            ╰── CtkHSV

Implemented Interfaces

CtkHSV implements AtkImplementorIface and CtkBuildable.

Includes

#include <ctk/ctk.h>

Description

CtkHSV is the “color wheel” part of a complete color selector widget. It allows to select a color by determining its HSV components in an intuitive way. Moving the selection around the outer ring changes the hue, and moving the selection point inside the inner triangle changes value and saturation.

Functions

ctk_hsv_new ()

CtkWidget *
ctk_hsv_new (void);

Creates a new HSV color selector.

Returns

A newly-created HSV color selector.

Since: 2.14


ctk_hsv_set_color ()

void
ctk_hsv_set_color (CtkHSV *hsv,
                   double h,
                   double s,
                   double v);

Sets the current color in an HSV color selector. Color component values must be in the [0.0, 1.0] range.

Parameters

hsv

An HSV color selector

 

h

Hue

 

s

Saturation

 

v

Value

 

Since: 2.14


ctk_hsv_get_color ()

void
ctk_hsv_get_color (CtkHSV *hsv,
                   gdouble *h,
                   gdouble *s,
                   gdouble *v);

Queries the current color in an HSV color selector. Returned values will be in the [0.0, 1.0] range.

Parameters

hsv

An HSV color selector

 

h

Return value for the hue.

[out]

s

Return value for the saturation.

[out]

v

Return value for the value.

[out]

Since: 2.14


ctk_hsv_set_metrics ()

void
ctk_hsv_set_metrics (CtkHSV *hsv,
                     gint size,
                     gint ring_width);

Sets the size and ring width of an HSV color selector.

Parameters

hsv

An HSV color selector

 

size

Diameter for the hue ring

 

ring_width

Width of the hue ring

 

Since: 2.14


ctk_hsv_get_metrics ()

void
ctk_hsv_get_metrics (CtkHSV *hsv,
                     gint *size,
                     gint *ring_width);

Queries the size and ring width of an HSV color selector.

Parameters

hsv

An HSV color selector

 

size

Return value for the diameter of the hue ring.

[out]

ring_width

Return value for the width of the hue ring.

[out]

Since: 2.14


ctk_hsv_is_adjusting ()

gboolean
ctk_hsv_is_adjusting (CtkHSV *hsv);

An HSV color selector can be said to be adjusting if multiple rapid changes are being made to its value, for example, when the user is adjusting the value with the mouse. This function queries whether the HSV color selector is being adjusted or not.

Parameters

hsv

A CtkHSV

 

Returns

TRUE if clients can ignore changes to the color value, since they may be transitory, or FALSE if they should consider the color value status to be final.

Since: 2.14


ctk_hsv_to_rgb ()

void
ctk_hsv_to_rgb (gdouble h,
                gdouble s,
                gdouble v,
                gdouble *r,
                gdouble *g,
                gdouble *b);

Converts a color from HSV space to RGB.

Input values must be in the [0.0, 1.0] range; output values will be in the same range.

Parameters

h

Hue

 

s

Saturation

 

v

Value

 

r

Return value for the red component.

[out]

g

Return value for the green component.

[out]

b

Return value for the blue component.

[out]

Since: 2.14


ctk_rgb_to_hsv ()

void
ctk_rgb_to_hsv (gdouble r,
                gdouble g,
                gdouble b,
                gdouble *h,
                gdouble *s,
                gdouble *v);

Converts a color from RGB space to HSV.

Input values must be in the [0.0, 1.0] range; output values will be in the same range.

Parameters

r

Red

 

g

Green

 

b

Blue

 

h

Return value for the hue component.

[out]

s

Return value for the saturation component.

[out]

v

Return value for the value component.

[out]

Since: 2.14

Types and Values

struct CtkHSV

struct CtkHSV;

Signal Details

The “changed” signal

void
user_function (CtkHSV  *ctkhsv,
               gpointer user_data)

Flags: Run First


The “move” signal

void
user_function (CtkHSV          *ctkhsv,
               CtkDirectionType arg1,
               gpointer         user_data)

Flags: Action

See Also

CtkColorSelection, CtkColorSelectionDialog