GTK+ Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Signals |
#include <gtk/gtk.h> GtkHSV; GtkWidget* gtk_hsv_new (void
); void gtk_hsv_set_color (GtkHSV *hsv
,double h
,double s
,double v
); void gtk_hsv_get_color (GtkHSV *hsv
,gdouble *h
,gdouble *s
,gdouble *v
); void gtk_hsv_set_metrics (GtkHSV *hsv
,gint size
,gint ring_width
); void gtk_hsv_get_metrics (GtkHSV *hsv
,gint *size
,gint *ring_width
); gboolean gtk_hsv_is_adjusting (GtkHSV *hsv
); void gtk_hsv_to_rgb (gdouble h
,gdouble s
,gdouble v
,gdouble *r
,gdouble *g
,gdouble *b
); void gtk_rgb_to_hsv (gdouble r
,gdouble g
,gdouble b
,gdouble *h
,gdouble *s
,gdouble *v
);
GtkHSV 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.
GtkWidget* gtk_hsv_new (void
);
Creates a new HSV color selector.
Returns : |
A newly-created HSV color selector. |
Since 2.14
void gtk_hsv_set_color (GtkHSV *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.
|
An HSV color selector |
|
Hue |
|
Saturation |
|
Value |
Since 2.14
void gtk_hsv_get_color (GtkHSV *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.
|
An HSV color selector |
|
Return value for the hue |
|
Return value for the saturation |
|
Return value for the value |
Since 2.14
void gtk_hsv_set_metrics (GtkHSV *hsv
,gint size
,gint ring_width
);
Sets the size and ring width of an HSV color selector.
|
An HSV color selector |
|
Diameter for the hue ring |
|
Width of the hue ring |
Since 2.14
void gtk_hsv_get_metrics (GtkHSV *hsv
,gint *size
,gint *ring_width
);
Queries the size and ring width of an HSV color selector.
|
An HSV color selector |
|
Return value for the diameter of the hue ring |
|
Return value for the width of the hue ring |
Since 2.14
gboolean gtk_hsv_is_adjusting (GtkHSV *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.
|
A GtkHSV |
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
void gtk_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.
|
Hue |
|
Saturation |
|
Value |
|
Return value for the red component |
|
Return value for the green component |
|
Return value for the blue component |
Since 2.14
void gtk_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.
|
Red |
|
Green |
|
Blue |
|
Return value for the hue component |
|
Return value for the saturation component |
|
Return value for the value component |
Since 2.14
"changed"
signalvoid user_function (GtkHSV *hsv, gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"move"
signalvoid user_function (GtkHSV *hsv, GtkDirectionType arg1, gpointer user_data) : Run Last / Action
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |