lv_colorwheel.h

Typedefs

typedef _lv_colorwheel_mode_t lv_colorwheel_mode_t

Enums

enum _lv_colorwheel_mode_t

Values:

enumerator LV_COLORWHEEL_MODE_HUE
enumerator LV_COLORWHEEL_MODE_SATURATION
enumerator LV_COLORWHEEL_MODE_VALUE

Functions

lv_obj_t *lv_colorwheel_create(lv_obj_t *parent, bool knob_recolor)

Create a color picker object with disc shape

Parameters:
  • parent -- pointer to an object, it will be the parent of the new color picker

  • knob_recolor -- true: set the knob's color to the current color

Returns:

pointer to the created color picker

bool lv_colorwheel_set_hsv(lv_obj_t *obj, lv_color_hsv_t hsv)

Set the current hsv of a color wheel.

Parameters:
  • obj -- pointer to color wheel object

  • hsv -- current selected hsv

Returns:

true if changed, otherwise false

bool lv_colorwheel_set_rgb(lv_obj_t *obj, lv_color_t color)

Set the current color of a color wheel.

Parameters:
  • obj -- pointer to color wheel object

  • color -- current selected color

Returns:

true if changed, otherwise false

void lv_colorwheel_set_mode(lv_obj_t *obj, lv_colorwheel_mode_t mode)

Set the current color mode.

Parameters:
  • obj -- pointer to color wheel object

  • mode -- color mode (hue/sat/val)

void lv_colorwheel_set_mode_fixed(lv_obj_t *obj, bool fixed)

Set if the color mode is changed on long press on center

Parameters:
  • obj -- pointer to color wheel object

  • fixed -- color mode cannot be changed on long press

lv_color_hsv_t lv_colorwheel_get_hsv(lv_obj_t *obj)

Get the current selected hsv of a color wheel.

Parameters:

obj -- pointer to color wheel object

Returns:

current selected hsv

lv_color_t lv_colorwheel_get_rgb(lv_obj_t *obj)

Get the current selected color of a color wheel.

Parameters:

obj -- pointer to color wheel object

Returns:

color current selected color

lv_colorwheel_mode_t lv_colorwheel_get_color_mode(lv_obj_t *obj)

Get the current color mode.

Parameters:

obj -- pointer to color wheel object

Returns:

color mode (hue/sat/val)

bool lv_colorwheel_get_color_mode_fixed(lv_obj_t *obj)

Get if the color mode is changed on long press on center

Parameters:

obj -- pointer to color wheel object

Returns:

mode cannot be changed on long press

Variables

const lv_obj_class_t lv_colorwheel_class
struct lv_colorwheel_t

Public Members

lv_obj_t obj
lv_color_hsv_t hsv
lv_point_t pos
uint8_t recolor
struct lv_colorwheel_t::[anonymous] knob
uint32_t last_click_time
uint32_t last_change_time
lv_point_t last_press_point
lv_colorwheel_mode_t mode
uint8_t mode_fixed