2 * @defgroup Colorselector Colorselector
5 * @image html img/widget/colorselector/preview-00.png
6 * @image latex img/widget/colorselector/preview-00.eps
8 * A ColorSelector is a color selection widget. It allows application to set a
9 * series of colors.It also allows to load/save colors from/to config with a
10 * unique identifier, by default, the colors are loaded/saved from/to config
11 * using "default" identifier.
12 * The colors can be picked by user from the color set by clicking on individual color
13 * item on the palette or by selecting it from selector.
15 * Signals that you can add callbacks for are:
16 * - "changed" - When the color value changes on selector(event_info is NULL).
17 * - "color,item,selected" - When user clicks on color item. The event_info parameter
18 * of the callback will be the selected color item.
19 * - "color,item,longpressed" - When user long presses on color item. The event info
20 * parameter of the callback contains selected color item.
22 * See @ref tutorial_colorselector.
26 typedef struct _Elm_Color_RGBA
34 typedef struct _Elm_Custom_Palette
36 const char *palette_name;
37 Eina_List *color_list;
41 * @enum _Elm_Colorselector_Mode
42 * @typedef Elm_Colorselector_Mode
44 * Different modes supported by Colorselector
46 * @see elm_colorselector_mode_set()
47 * @see elm_colorselector_mode_get()
51 ELM_COLORSELECTOR_PALETTE = 0, /**< only color palette is displayed */
52 ELM_COLORSELECTOR_COMPONENTS, /**< only color selector is displayed */
53 ELM_COLORSELECTOR_BOTH /**< Both Palette and selector is displayed, default */
54 } Elm_Colorselector_Mode;
57 * @brief Add a new colorselector to the parent
59 * @param parent The parent object
60 * @return The new object or NULL if it cannot be created
62 * @ingroup Colorselector
64 EAPI Evas_Object *elm_colorselector_add(Evas_Object *parent);
67 * Set color to colorselector
69 * @param obj Colorselector object
70 * @param r r-value of color
71 * @param g g-value of color
72 * @param b b-value of color
73 * @param a a-value of color
75 * @ingroup Colorselector
77 EAPI void elm_colorselector_color_set(Evas_Object *obj, int r, int g, int b, int a);
80 * Get current color from colorselector
82 * @param obj Colorselector object
83 * @param r integer pointer for r-value of color
84 * @param g integer pointer for g-value of color
85 * @param b integer pointer for b-value of color
86 * @param a integer pointer for a-value of color
88 * @ingroup Colorselector
90 EAPI void elm_colorselector_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a);
93 * Set Colorselector's mode.
95 * @param obj Colorselector object
96 * @param mode Elm_Colorselector_Mode
98 * Colorselector supports three modes palette only, selector only and both.
100 * @ingroup Colorselector
102 EAPI void elm_colorselector_mode_set(Evas_Object *obj, Elm_Colorselector_Mode mode);
105 * Get Colorselector's mode.
107 * @param obj Colorselector object
108 * @return mode The current mode of colorselector
110 * @ingroup Colorselector
112 EAPI Elm_Colorselector_Mode elm_colorselector_mode_get(const Evas_Object *obj);
115 * Get Palette item's color.
117 * @param it The color palette item.
118 * @param r integer pointer for r-value of color
119 * @param g integer pointer for g-value of color
120 * @param b integer pointer for b-value of color
121 * @param a integer pointer for a-value of color
123 * @ingroup Colorselector
125 EAPI void elm_colorselector_palette_item_color_get(const Elm_Object_Item *it, int *r, int *g, int *b, int *a);
128 * Set palette item's color.
130 * @param it The color palette item.
131 * @param r r-value of color
132 * @param g g-value of color
133 * @param b b-value of color
134 * @param a a-value of color
136 * @ingroup Colorselector
138 EAPI void elm_colorselector_palette_item_color_set(Elm_Object_Item *it, int r, int g, int b, int a);
141 * Add a new color item to palette.
143 * @param obj The Colorselector object
144 * @param r r-value of color
145 * @param g g-value of color
146 * @param b b-value of color
147 * @param a a-value of color
148 * @return A new color palette Item.
150 * @ingroup Colorselector
152 EAPI Elm_Object_Item *elm_colorselector_palette_color_add(Evas_Object *obj, int r, int g, int b, int a);
155 * Clear the palette items.
157 * @param obj The Colorselector object
159 * @ingroup Colorselector
161 EAPI void elm_colorselector_palette_clear(Evas_Object *obj);
164 * Set current palette's name
166 * @param obj The Colorselector object
167 * @param palette_name Name of palette
169 * When colorpalette name is set, colors will be loaded from and saved to config
170 * using the set name. If no name is set then colors will be loaded from or
171 * saved to "default" config.
173 * @ingroup Colorselector
175 EAPI void elm_colorselector_palette_name_set(Evas_Object *obj, const char *palette_name);
178 * Get current palette's name
180 * @param obj The Colorselector object
181 * @return Name of palette
183 * Returns the currently set palette name using which colors will be
184 * saved/loaded in to config.
186 * @ingroup Colorselector
188 EAPI const char *elm_colorselector_palette_name_get(const Evas_Object *obj);