Table Of Contents

Previous topic

clock Module

Next topic

configuration Module

colorselector Module

../_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.

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

  • "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.

  • focused - When the colorselector has received focus. (since 1.8)

  • unfocused - When the colorselector has lost focus. (since 1.8)

Enumerations

Colorselector modes

efl.elementary.colorselector.ELM_COLORSELECTOR_PALETTE

Show palette

efl.elementary.colorselector.ELM_COLORSELECTOR_COMPONENTS

Show components

efl.elementary.colorselector.ELM_COLORSELECTOR_BOTH

Show palette and components

class efl.elementary.colorselector.Colorselector

Bases: efl.elementary.layout_class.LayoutClass

This is the class that actually implements the widget.

callback_changed_add()

When the color value changes on selector

callback_color_item_longpressed_add()

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

callback_color_item_selected_add()

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

callback_focused_add()

When the check has received focus.

New in version 1.8.

callback_unfocused_add()

When the check has lost focus.

New in version 1.8.

color

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

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

Colorselector’s mode.

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

Type :Colorselector modes
palette_clear()

Clear the palette items.

palette_color_add(int r, int g, int b, int a) → ColorselectorPaletteItem

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_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
class efl.elementary.colorselector.ColorselectorPaletteItem

Bases: efl.elementary.object_item.ObjectItem

An item for the Colorselector widget.

color

The palette items color.

Type :(int r, int g, int b, int a)