GnomeColorPicker

Name

GnomeColorPicker — Widget for selecting colors.

Synopsis


#include <gnome.h>


struct      GnomeColorPicker
GtkWidget*  gnome_color_picker_new          (void);
void        gnome_color_picker_set_d        (GnomeColorPicker *cp,
                                             gdouble r,
                                             gdouble g,
                                             gdouble b,
                                             gdouble a);
void        gnome_color_picker_get_d        (GnomeColorPicker *cp,
                                             gdouble *r,
                                             gdouble *g,
                                             gdouble *b,
                                             gdouble *a);
void        gnome_color_picker_set_i8       (GnomeColorPicker *cp,
                                             guint8 r,
                                             guint8 g,
                                             guint8 b,
                                             guint8 a);
void        gnome_color_picker_get_i8       (GnomeColorPicker *cp,
                                             guint8 *r,
                                             guint8 *g,
                                             guint8 *b,
                                             guint8 *a);
void        gnome_color_picker_set_i16      (GnomeColorPicker *cp,
                                             gushort r,
                                             gushort g,
                                             gushort b,
                                             gushort a);
void        gnome_color_picker_get_i16      (GnomeColorPicker *cp,
                                             gushort *r,
                                             gushort *g,
                                             gushort *b,
                                             gushort *a);
void        gnome_color_picker_set_dither   (GnomeColorPicker *cp,
                                             gboolean dither);
void        gnome_color_picker_set_use_alpha
                                            (GnomeColorPicker *cp,
                                             gboolean use_alpha);
void        gnome_color_picker_set_title    (GnomeColorPicker *cp,
                                             const gchar *title);

Object Hierarchy


  GtkObject
   +----GtkWidget
         +----GtkContainer
               +----GtkBin
                     +----GtkButton
                           +----GnomeColorPicker

Signal Prototypes


'color-set' void        user_function      (GnomeColorPicker *colorpicker,
                                            guint arg1,
                                            guint arg2,
                                            guint arg3,
                                            guint arg4,
                                            gpointer user_data);

Description

This widget provides color selection facilities to your application. It is a button that renders its current color and when pressed presents the user with a color selector from which he can choose a color.

You can select the color to be displayed in a number of ways: floating point values for the red, green and blue channels, or integers in the range 0 to 65,535 or intergers in the range 0 to 255 depending on your needs.

Details


GnomeColorPicker

struct GnomeColorPicker;


gnome_color_picker_new()

GtkWidget*  gnome_color_picker_new          (void);

Creates a new GNOME color picker widget.

Returns :Pointer to new GNOME color picker widget.


gnome_color_picker_set_d()

void        gnome_color_picker_set_d        (GnomeColorPicker *cp,
                                             gdouble r,
                                             gdouble g,
                                             gdouble b,
                                             gdouble a);

Set color currently shown in color picker widget.

cp : Pointer to GNOME color picker widget.r : Red color component, values are in [0.0, 1.0]g : Green color component, values are in [0.0, 1.0]b : Blue color component, values are in [0.0, 1.0]a : Alpha color component, values are in [0.0, 1.0]


gnome_color_picker_get_d()

void        gnome_color_picker_get_d        (GnomeColorPicker *cp,
                                             gdouble *r,
                                             gdouble *g,
                                             gdouble *b,
                                             gdouble *a);

Retrieve color currently set in color picker widget.

cp : Pointer to GNOME color picker widget.r : Output location of red color component, values are in [0.0, 1.0]g : Output location of green color component, values are in [0.0, 1.0]b : Output location of blue color component, values are in [0.0, 1.0]a : Output location of alpha color component, values are in [0.0, 1.0]


gnome_color_picker_set_i8()

void        gnome_color_picker_set_i8       (GnomeColorPicker *cp,
                                             guint8 r,
                                             guint8 g,
                                             guint8 b,
                                             guint8 a);

Set color currently set in color picker widget.

cp : Pointer to GNOME color picker widget.r : Red color component, values are in [0, 255]g : Green color component, values are in [0, 255]b : Blue color component, values are in [0, 255]a : Alpha color component, values are in [0, 255]


gnome_color_picker_get_i8()

void        gnome_color_picker_get_i8       (GnomeColorPicker *cp,
                                             guint8 *r,
                                             guint8 *g,
                                             guint8 *b,
                                             guint8 *a);

Retrieve color currently set in color picker widget.

cp : Pointer to GNOME color picker widget.r : Output location of red color component, values are in [0, 255]g : Output location of green color component, values are in [0, 255]b : Output location of blue color component, values are in [0, 255]a : Output location of alpha color component, values are in [0, 255]


gnome_color_picker_set_i16()

void        gnome_color_picker_set_i16      (GnomeColorPicker *cp,
                                             gushort r,
                                             gushort g,
                                             gushort b,
                                             gushort a);

Set color currently set in color picker widget.

cp : Pointer to GNOME color picker widget.r : Red color component, values are in [0, 65535]g : Green color component, values are in [0, 65535]b : Blue color component, values are in [0, 65535]a : Alpha color component, values are in [0, 65535]


gnome_color_picker_get_i16()

void        gnome_color_picker_get_i16      (GnomeColorPicker *cp,
                                             gushort *r,
                                             gushort *g,
                                             gushort *b,
                                             gushort *a);

Retrieve color currently set in color picker widget.

cp : Pointer to GNOME color picker widget.r : Output location of red color component, values are in [0, 65535]g : Output location of green color component, values are in [0, 65535]b : Output location of blue color component, values are in [0, 65535]a : Output location of alpha color component, values are in [0, 65535]


gnome_color_picker_set_dither()

void        gnome_color_picker_set_dither   (GnomeColorPicker *cp,
                                             gboolean dither);

Sets whether the picker should dither the color sample or just paint a solid rectangle.

cp : Pointer to GNOME color picker widget.dither : TRUE if color sample should be dithered, FALSE if not.


gnome_color_picker_set_use_alpha()

void        gnome_color_picker_set_use_alpha
                                            (GnomeColorPicker *cp,
                                             gboolean use_alpha);

Sets whether the picker should use the alpha channel or not.

cp : Pointer to GNOME color picker widget.use_alpha : 


gnome_color_picker_set_title()

void        gnome_color_picker_set_title    (GnomeColorPicker *cp,
                                             const gchar *title);

Sets the title for the color selection dialog.

cp : Pointer to GNOME color picker widget.title : String containing new window title.

Signals


The 'color-set' signal

void        user_function                  (GnomeColorPicker *colorpicker,
                                            guint arg1,
                                            guint arg2,
                                            guint arg3,
                                            guint arg4,
                                            gpointer user_data);

This signal is emitted when the user changes the color on the color selector. The values passed to this signal are the red, green, blue and alpha channels selected in integer form in the range 0 to 65535.

colorpicker :the object which received the signal.arg1 : arg2 : arg3 : arg4 : user_data :user data set when the signal handler was connected.