|
|
|
|
Etk_Colorpicker
Detailed Description
The colorpicker is a widget that allows the user to select a color.
A colorpicker can work in 6 different modes, H (Hue), S (saturation), V (value), R (red), G (green) and B (blue). The default mode is H, but you can change it with etk_colorpicker_mode_set(). For each of these modes, there is a slider that allows the user to change the corresponding value.
Optionally, the colorpicker can also have a slider to control the alpha channel of the color, corresponding to how much the color is transparent. This slider is hidden by default, but can be shown with etk_colorpicker_use_alpha_set().
Most of the time, all you want to do is getting the selected color, and be notified when the selected color is changed. This can be done with etk_colorpicker_current_color_get() and by connecting a callback to the "color-changed" signal.
- Object Hierarchy:
-
- Signals:
- "color-changed": Emitted when the selected color is changed
Callback: Etk_Bool callback(Etk_Colorpicker *colorpicker, void *data)
button: the colorpicker whose color has been changeddata: the user data set when the callback has been connected to the signal
- Properties:
- "color-mode": The current color-mode of the colorpicker
Type: Integer (Etk_Colorpicker_Mode)Access: Read/WriteDefault Value: ETK_COLORPICKER_H
- "use-alpha": Whether or not the alpha slider is visible
Type: BooleanAccess: Read/WriteDefault Value: ETK_FALSE
|
Data Structures |
struct | Etk_Colorpicker |
| [Widget] A widget that allows the user to select a color More...
|
Defines |
#define | ETK_COLORPICKER_TYPE (etk_colorpicker_type_get()) |
#define | ETK_COLORPICKER(obj) (ETK_OBJECT_CAST((obj), ETK_COLORPICKER_TYPE, Etk_Colorpicker)) |
#define | ETK_IS_COLORPICKER(obj) (ETK_OBJECT_CHECK_TYPE((obj), ETK_COLORPICKER_TYPE)) |
Enumerations |
enum | Etk_Colorpicker_Mode {
ETK_COLORPICKER_H,
ETK_COLORPICKER_S,
ETK_COLORPICKER_V,
ETK_COLORPICKER_R,
ETK_COLORPICKER_G,
ETK_COLORPICKER_B
} |
| The different color modes that can be used by the colorpicker. More...
|
Functions |
Etk_Widget * | etk_colorpicker_new (void) |
| Creates a new colorpicker.
|
void | etk_colorpicker_mode_set (Etk_Colorpicker *cp, Etk_Colorpicker_Mode mode) |
| Sets the current color mode of the colorpicker.
|
Etk_Colorpicker_Mode | etk_colorpicker_mode_get (Etk_Colorpicker *cp) |
| Gets the current color mode of the colorpicker.
|
void | etk_colorpicker_current_color_set (Etk_Colorpicker *cp, Etk_Color color) |
| Sets the color currently selected by the colorpicker.
|
Etk_Color | etk_colorpicker_current_color_get (Etk_Colorpicker *cp) |
| Gets the color currently selected by the colorpicker.
|
void | etk_colorpicker_use_alpha_set (Etk_Colorpicker *cp, Etk_Bool use_alpha) |
| Sets whether or not the colorpicker has a slider that allows the user to choose the alpha component of the color.
|
Etk_Bool | etk_colorpicker_use_alpha_get (Etk_Colorpicker *cp) |
| Gets whether the colorpicker has an alpha slider.
|
Define Documentation
#define ETK_COLORPICKER_TYPE (etk_colorpicker_type_get()) |
Gets the type of a colorpicker
#define ETK_COLORPICKER |
( |
obj |
|
) |
(ETK_OBJECT_CAST((obj), ETK_COLORPICKER_TYPE, Etk_Colorpicker)) |
Casts the object to a colorpicker
#define ETK_IS_COLORPICKER |
( |
obj |
|
) |
(ETK_OBJECT_CHECK_TYPE((obj), ETK_COLORPICKER_TYPE)) |
Enumeration Type Documentation
The different color modes that can be used by the colorpicker.
- Enumerator:
-
ETK_COLORPICKER_H |
The "Hue" mode |
ETK_COLORPICKER_S |
The "Saturation" mode |
ETK_COLORPICKER_V |
The "Value" mode |
ETK_COLORPICKER_R |
The "Red" mode |
ETK_COLORPICKER_G |
The "Green" mode |
ETK_COLORPICKER_B |
The "Blue" mode |
Function Documentation
Creates a new colorpicker.
- Returns:
- Returns the new colorpicker
Sets the current color mode of the colorpicker.
- Parameters:
-
| cp | a colorpicker |
| mode | the color mode to use |
Gets the current color mode of the colorpicker.
- Parameters:
-
- Returns:
- Returns the current color mode of the colorpicker
Sets the color currently selected by the colorpicker.
- Parameters:
-
| cp | a colorpicker |
| color | the color to set |
Gets the color currently selected by the colorpicker.
- Parameters:
-
- Returns:
- Returns the color selected by the colorpicker
void etk_colorpicker_use_alpha_set |
( |
Etk_Colorpicker * |
cp, |
|
|
Etk_Bool |
use_alpha | |
|
) |
| | |
Sets whether or not the colorpicker has a slider that allows the user to choose the alpha component of the color.
- Parameters:
-
| cp | a colorpicher |
| use_alpha | ETK_TRUE to make the colorpicker have an alpha slider, ETK_FALSE otherwise |
Gets whether the colorpicker has an alpha slider.
- Parameters:
-
- Returns:
- Returns ETK_TRUE if the colorpicker has an alpha slider, ETK_FALSE otherwise
|
|
|
|
|
|