Colorselector

../_images/colorselector-preview.png

Widget description

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.

Emitted signals

  • "changed" - When the color value changes on selector

  • "color,item,selected" - When user clicks on color item.

    The event_info parameter of the callback will be the selected color item.

  • "color,item,longpressed" - When user long presses on color item.

    The event_info parameter of the callback will be the selected color item.

Enumerations

Colorselector modes

efl.elementary.ELM_COLORSELECTOR_PALETTE

Show palette

efl.elementary.ELM_COLORSELECTOR_COMPONENTS

Show components

efl.elementary.ELM_COLORSELECTOR_BOTH

Show palette and components

Inheritance diagram

Inheritance diagram of Colorselector, ColorselectorPaletteItem

class efl.elementary.Colorselector(Object parent, *args, **kwargs)

Bases: efl.elementary.__init__.LayoutClass

Parameters:
  • parent (efl.evas.Object) – The parent object
  • **kwargs – All the remaining keyword arguments are interpreted as properties of the instance
callback_changed_add(func, *args, **kwargs)

When the color value changes on selector

callback_changed_del(func)
callback_changed_user_add(func, *args, **kwargs)

When the color value is changed by the user

New in version 1.14.

callback_changed_user_del(func)

New in version 1.14.

callback_color_item_longpressed_add(func, *args, **kwargs)

When user long presses on color item. The event_info parameter of the callback will be the selected color item.

callback_color_item_longpressed_del(func)
callback_color_item_selected_add(func, *args, **kwargs)

When user clicks on color item. The event_info parameter of the callback will be the selected color item.

callback_color_item_selected_del(func)
color

The current color (r, g, b, a).

Type:(int r, int g, int b, int a)
color_get()
color_set(r, g, b, a)
mode

Colorselector’s mode.

Colorselector supports three modes palette only, selector only and both.

Type:Colorselector modes
mode_get()
mode_set(mode)
palette_clear()

Clear the palette items.

palette_color_add(r, g, b, a)

Add a new color item to palette.

Parameters:
  • r (int) – r-value of color
  • g (int) – g-value of color
  • b (int) – b-value of color
  • a (int) – a-value of color
Returns:

A new color palette Item.

Return type:

ColorselectorPaletteItem

palette_items_get()

Get a list of palette items (colors).

Returns:A list of palette Items.
Return type:list of ColorselectorPaletteItem

New in version 1.9.

palette_name

The 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.

Type:string
palette_name_get()
palette_name_set(palette_name)
palette_selected_item_get()

Get the selected item in the palette.

Returns:the selected item.
Return type:list of ColorselectorPaletteItem

New in version 1.9.

class efl.elementary.ColorselectorPaletteItem(int r, int g, int b, int a, *args, **kwargs)

Bases: efl.elementary.__init__.ObjectItem

Parameters:
  • r (int) – Red value of color
  • g (int) – Green value of color
  • b (int) – Blue value of color
  • a (int) – Alpha value of color
  • **kwargs – All the remaining keyword arguments are interpreted as properties of the instance
add_to(cs)
color

The palette items color.

Type:(int r, int g, int b, int a)
color_get()
color_set(r, g, b, a)
selected

Whenever the palette item is selected or not.

Type:bool

New in version 1.9.

selected_get()
selected_set(selected)