acid-drop- Hacking the planet from a LilyGo T-Deck using custom firmware |
git clone git://git.acid.vegas/acid-drop.git |
Log | Files | Refs | Archive | README | LICENSE |
colorwheel.md (1992B)
1 ```eval_rst 2 .. include:: /header.rst 3 :github_url: |github_link_base|/widgets/extra/colorwheel.md 4 ``` 5 # Color wheel (lv_colorwheel) 6 7 ## Overview 8 As its name implies *Color wheel* allows the user to select a color. The Hue, Saturation and Value of the color can be selected separately. 9 10 Long pressing the object, the color wheel will change to the next parameter of the color (hue, saturation or value). A double click will reset the current parameter. 11 12 ## Parts and Styles 13 - `LV_PART_MAIN` Only `arc_width` is used to set the width of the color wheel 14 - `LV_PART_KNOB` A rectangle (or circle) drawn on the current value. It uses all the rectangle like style properties and padding to make it larger than the width of the arc. 15 16 ## Usage 17 18 ### Create a color wheel 19 20 `lv_colorwheel_create(parent, knob_recolor)` creates a new color wheel. With `knob_recolor=true` the knob's background color will be set to the current color. 21 22 ### Set color 23 24 The color can be set manually with `lv_colorwheel_set_hue/saturation/value(colorwheel, x)` or all at once with `lv_colorwheel_set_hsv(colorwheel, hsv)` or `lv_colorwheel_set_color(colorwheel, rgb)` 25 26 ### Color mode 27 28 The current color mode can be manually selected with `lv_colorwheel_set_mode(colorwheel, LV_COLORWHEEL_MODE_HUE/SATURATION/VALUE)`. 29 30 The color mode can be fixed (so as to not change with long press) using `lv_colorwheel_set_mode_fixed(colorwheel, true)` 31 32 ## Events 33 - `LV_EVENT_VALUE_CHANGED` Sent if a new color is selected. 34 35 Learn more about [Events](/overview/event). 36 37 ## Keys 38 - `LV_KEY_UP`, `LV_KEY_RIGHT` Increment the current parameter's value by 1 39 - `LV_KEY_DOWN`, `LV_KEY_LEFT` Decrement the current parameter's value by 1 40 - `LV_KEY_ENTER` A long press will show the next mode. Double click to reset the current parameter. 41 42 Learn more about [Keys](/overview/indev). 43 44 ## Example 45 46 ```eval_rst 47 48 .. include:: ../../../examples/widgets/colorwheel/index.rst 49 50 ``` 51 52 ## API 53 54 ```eval_rst 55 56 .. doxygenfile:: lv_colorwheel.h 57 :project: lvgl 58 59 ```