Tizen Native API  5.0
Colorselector

colorselector_inheritance_tree.png

A ColorSelector is a color selection widget. It allows application to set a series of colors.It also allows to load/save colors from/to config with a unique identifier, by default, the colors are loaded/saved from/to config using "default" identifier. The colors can be picked by user from the color set by clicking on individual color item on the palette or by selecting it from selector.

This widget inherits from the Layout one, so that all the functions acting on it also work for check objects.

This widget emits the following signals, besides the ones sent from Elm_Layout:

See Color selector example.

Functions

void elm_colorselector_color_set (Elm_Colorselector *obj, int r, int g, int b, int a)
 Set color to colorselector.
void elm_colorselector_color_get (const Elm_Colorselector *obj, int *r, int *g, int *b, int *a)
 Get current color from colorselector.
void elm_colorselector_palette_name_set (Elm_Colorselector *obj, const char *palette_name)
 Set current palette's name.
const char * elm_colorselector_palette_name_get (const Elm_Colorselector *obj)
 Get current palette's name.
void elm_colorselector_mode_set (Elm_Colorselector *obj, Elm_Colorselector_Mode mode)
 Set Colorselector's mode.
Elm_Colorselector_Mode elm_colorselector_mode_get (const Elm_Colorselector *obj)
 Get Colorselector's mode.
const Eina_Listelm_colorselector_palette_items_get (const Elm_Colorselector *obj)
 Get list of palette items.
Elm_Widget_Item * elm_colorselector_palette_color_add (Elm_Colorselector *obj, int r, int g, int b, int a)
 Add a new color item to palette.
void elm_colorselector_palette_clear (Elm_Colorselector *obj)
 Clear the palette items.
void elm_colorselector_palette_item_color_get (const Elm_Object_Item *it, int *r, int *g, int *b, int *a)
 Get Palette item's color.
void elm_colorselector_palette_item_color_set (Elm_Object_Item *it, int r, int g, int b, int a)
 Set palette item's color.
Eina_Bool elm_colorselector_palette_item_selected_get (const Elm_Object_Item *it)
 Get the selected state of color palette item.
void elm_colorselector_palette_item_selected_set (Elm_Object_Item *it, Eina_Bool selected)
 Set the selected state of color palette item.
Evas_Objectelm_colorselector_add (Evas_Object *parent)
 Add a new colorselector to the parent.

Enumeration Type Documentation

Enumerator:
ELM_COLORSELECTOR_PALETTE 

Only color palette is displayed, default

ELM_COLORSELECTOR_COMPONENTS 

Only color selector is displayed

ELM_COLORSELECTOR_BOTH 

Both Palette and selector is displayed

ELM_COLORSELECTOR_PICKER 

Only color picker is displayed

ELM_COLORSELECTOR_PLANE 
Deprecated:
This mode is not supported. If you use this, nothing will be shown
ELM_COLORSELECTOR_PALETTE_PLANE 
Deprecated:
This mode is not supported. If you use this, it will be shown same with ELM_COLORSELECTOR_PALETTE mode
ELM_COLORSELECTOR_ALL 
Deprecated:
This mode is not supported. If you use this, it will be shown same with ELM_COLORSELECTOR_PALETTE mode

Function Documentation

Add a new colorselector to the parent.

Parameters:
parentThe parent object
Returns:
The new object or NULL if it cannot be created
Since :
2.3
void elm_colorselector_color_get ( const Elm_Colorselector *  obj,
int *  r,
int *  g,
int *  b,
int *  a 
)

Get current color from colorselector.

Since :
2.3
Parameters:
[in]objThe object.
[out]rr-value of color
[out]gg-value of color
[out]bb-value of color
[out]aa-value of color
void elm_colorselector_color_set ( Elm_Colorselector *  obj,
int  r,
int  g,
int  b,
int  a 
)

Set color to colorselector.

Since :
2.3
Parameters:
[in]objThe object.
[in]rr-value of color
[in]gg-value of color
[in]bb-value of color
[in]aa-value of color
Elm_Colorselector_Mode elm_colorselector_mode_get ( const Elm_Colorselector *  obj)

Get Colorselector's mode.

Since :
2.3
Parameters:
[in]objThe object.
Returns:
Elm_Colorselector_Mode
void elm_colorselector_mode_set ( Elm_Colorselector *  obj,
Elm_Colorselector_Mode  mode 
)

Set Colorselector's mode.

Colorselector supports three modes palette only, selector only and both. Only palette mode is supported in Tizen 3.0.

Since :
2.3
Parameters:
[in]objThe object.
[in]modeElm_Colorselector_Mode
void elm_colorselector_palette_clear ( Elm_Colorselector *  obj)

Clear the palette items.

Since :
2.3
Parameters:
[in]objThe object.
Elm_Widget_Item* elm_colorselector_palette_color_add ( Elm_Colorselector *  obj,
int  r,
int  g,
int  b,
int  a 
)

Add a new color item to palette.

Since :
2.3
Parameters:
[in]objThe object.
[in]rr-value of color
[in]gg-value of color
[in]bb-value of color
[in]aa-value of color
Returns:
A new color palette Item.
void elm_colorselector_palette_item_color_get ( const Elm_Object_Item it,
int *  r,
int *  g,
int *  b,
int *  a 
)

Get Palette item's color.

Since :
2.3
Parameters:
[in]itThe color palette item.
[out]rinteger pointer for r-value of color
[out]ginteger pointer for g-value of color
[out]binteger pointer for b-value of color
[out]ainteger pointer for a-value of color
void elm_colorselector_palette_item_color_set ( Elm_Object_Item it,
int  r,
int  g,
int  b,
int  a 
)

Set palette item's color.

Since :
2.3
Parameters:
[in]itThe color palette item.
[in]rr-value of color
[in]gg-value of color
[in]bb-value of color
[in]aa-value of color

Get the selected state of color palette item.

Since :
2.3.1
Parameters:
[in]itThe Colorpalette item
Returns:
EINA_TRUE if the item is selected, EINA_FALSE otherwise.

Set the selected state of color palette item.

Since :
2.3.1
Parameters:
[in]itThe Colorpalette item
[in]selectedThe selected state
const Eina_List* elm_colorselector_palette_items_get ( const Elm_Colorselector *  obj)

Get list of palette items.

Note That palette item list is internally managed by colorselector widget and it should not be freed/modified by application.

Since :
2.3
Parameters:
[in]objThe object.
Returns:
The list of color palette items.
Since (EFL) :
1.9
const char* elm_colorselector_palette_name_get ( const Elm_Colorselector *  obj)

Get current palette's name.

Returns the currently set palette name using which colors will be saved/loaded in to config.

Since :
2.3
Parameters:
[in]objThe object.
Returns:
Name of palette
void elm_colorselector_palette_name_set ( Elm_Colorselector *  obj,
const char *  palette_name 
)

Set current palette's name.

When colorpalette name is set, colors will be loaded from and saved to config using the set name. If no name is set then colors will be loaded from or saved to "default" config.

Since :
2.3
Parameters:
[in]objThe object.
[in]palette_nameName of palette