mikroSDK Reference Manual
lv_colorwheel.h
Go to the documentation of this file.
1
6#ifndef LV_COLORWHEEL_H
7#define LV_COLORWHEEL_H
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13/*********************
14 * INCLUDES
15 *********************/
16#include "../../../lvgl.h"
17
18#if LV_USE_COLORWHEEL
19
20/*********************
21 * DEFINES
22 *********************/
23
24/**********************
25 * TYPEDEFS
26 **********************/
27
28enum {
29 LV_COLORWHEEL_MODE_HUE,
30 LV_COLORWHEEL_MODE_SATURATION,
31 LV_COLORWHEEL_MODE_VALUE
32};
33typedef uint8_t lv_colorwheel_mode_t;
34
35
36/*Data of color picker*/
37typedef struct {
38 lv_obj_t obj;
40 struct {
41 lv_point_t pos;
42 uint8_t recolor : 1;
43 } knob;
44 uint32_t last_click_time;
45 uint32_t last_change_time;
46 lv_point_t last_press_point;
47 lv_colorwheel_mode_t mode : 2;
48 uint8_t mode_fixed : 1;
49} lv_colorwheel_t;
50
51extern const lv_obj_class_t lv_colorwheel_class;
52
53/**********************
54 * GLOBAL PROTOTYPES
55 **********************/
56
63lv_obj_t * lv_colorwheel_create(lv_obj_t * parent, bool knob_recolor);
64
65/*=====================
66 * Setter functions
67 *====================*/
68
75bool lv_colorwheel_set_hsv(lv_obj_t * obj, lv_color_hsv_t hsv);
76
83bool lv_colorwheel_set_rgb(lv_obj_t * obj, lv_color_t color);
84
90void lv_colorwheel_set_mode(lv_obj_t * obj, lv_colorwheel_mode_t mode);
91
97void lv_colorwheel_set_mode_fixed(lv_obj_t * obj, bool fixed);
98
99/*=====================
100 * Getter functions
101 *====================*/
102
108lv_color_hsv_t lv_colorwheel_get_hsv(lv_obj_t * obj);
109
115lv_color_t lv_colorwheel_get_rgb(lv_obj_t * obj);
116
122lv_colorwheel_mode_t lv_colorwheel_get_color_mode(lv_obj_t * obj);
123
129bool lv_colorwheel_get_color_mode_fixed(lv_obj_t * obj);
130
131/**********************
132 * MACROS
133 **********************/
134
135#endif /*LV_USE_COLORWHEEL*/
136
137#ifdef __cplusplus
138} /*extern "C"*/
139#endif
140
141#endif /*LV_COLORWHEEL_H*/
142
Definition lv_obj_class.h:49
Definition lv_obj.h:174
Definition lv_color.h:237
Definition lv_area.h:37