lv_grad.h
API reference for lv_grad.h
Summary
Functions
misc/lv_grad.h:153function
lv_grad_radial_set_focal
Set focal (starting) circle of a radial gradient
void lv_grad_radial_set_focal(lv_grad_dsc_t *dsc, int32_t center_x, int32_t center_y, int32_t radius)| Name | Type | Description |
|---|---|---|
dsc | lv_grad_dsc_t * | gradient descriptor |
center_x | int32_t | center x position: can be a coordinate or an lv_pct() value predefined constants LV_GRAD_LEFT, LV_GRAD_RIGHT, LV_GRAD_TOP, LV_GRAD_BOTTOM, LV_GRAD_CENTER can be used as well |
center_y | int32_t | center y position |
radius | int32_t | radius of the starting circle (NOTE: this must be a scalar number, not percentage) |
Enums
lv_grad_dir_t
The direction of the gradient.
| Name | Description |
|---|---|
LV_GRAD_DIR_NONE | No gradient (the grad_color property is ignored) |
LV_GRAD_DIR_VER | Simple vertical (top to bottom) gradient |
LV_GRAD_DIR_HOR | Simple horizontal (left to right) gradient |
LV_GRAD_DIR_LINEAR | Linear gradient defined by start and end points. Can be at any angle. |
LV_GRAD_DIR_RADIAL | Radial gradient defined by start and end circles |
LV_GRAD_DIR_CONICAL | Conical gradient defined by center point, start and end angles |
Used by 2 functions
lv_obj_set_style_bg_grad_dir— paramvaluelv_style_set_bg_grad_dir— paramvalue
lv_grad_extend_t
Gradient behavior outside the defined range.
| Name | Description |
|---|---|
LV_GRAD_EXTEND_PAD | Repeat the same color |
LV_GRAD_EXTEND_REPEAT | Repeat the pattern |
LV_GRAD_EXTEND_REFLECT | Repeat the pattern mirrored |
Used by 3 functions
lv_grad_linear_init— paramextendlv_grad_radial_init— paramextendlv_grad_conical_init— paramextend
Structs
struct
lv_grad_stop_t
A gradient stop definition. This matches a color and a position in a virtual 0-255 scale.
| Member | Type | Description |
|---|---|---|
color | lv_color_t | The stop color |
opa | lv_opa_t | The opacity of the color |
frac | uint8_t | The stop position in 1/255 unit |
Used by 2 functions
lv_draw_vector_dsc_set_fill_gradient_color_stops— paramstopslv_draw_vector_dsc_set_stroke_gradient_color_stops— paramstops
struct
lv_grad_dsc_t
A descriptor of a gradient.
| Member | Type | Description |
|---|---|---|
stops | lv_grad_stop_t[2] | A gradient stop array |
stops_count | uint8_t | The number of used stops in the array |
dir | lv_grad_dir_t | The gradient direction. Any of LV_GRAD_DIR_NONE, LV_GRAD_DIR_VER, LV_GRAD_DIR_HOR, LV_GRAD_TYPE_LINEAR, LV_GRAD_TYPE_RADIAL, LV_GRAD_TYPE_CONICAL |
extend | lv_grad_extend_t | Behaviour outside the defined range. LV_GRAD_EXTEND_NONE, LV_GRAD_EXTEND_PAD, LV_GRAD_EXTEND_REPEAT, LV_GRAD_EXTEND_REFLECT |
start | lv_point_t | Linear gradient vector start point |
end | lv_point_t | Linear gradient vector end point Center of the ending circle in local coordinates |
linear | struct lv_grad_dsc_t | |
focal | lv_point_t | Center of the focal (starting) circle in local coordinates |
focal_extent | lv_point_t | Point on the circle (can be the same as the center) |
end_extent | lv_point_t | Point on the circle determining the radius of the gradient |
radial | struct lv_grad_dsc_t | |
center | lv_point_t | Conical gradient center point |
start_angle | int16_t | Start angle 0..3600 |
end_angle | int16_t | End angle 0..3600 |
conical | struct lv_grad_dsc_t | |
params | union lv_grad_dsc_t | |
state | void * |
Used by 23 functions
lv_obj_set_style_bg_grad— paramvaluelv_nanovg_draw_grad_helper— paramgrad_dsclv_nemagfx_grad_set— paramlv_gradlv_draw_sw_grad_color_calculate— paramdsclv_draw_sw_grad_get— paramgradientlv_draw_sw_grad_linear_setup— paramdsclv_draw_sw_grad_linear_cleanup— paramdsclv_draw_sw_grad_linear_get_line— paramdsclv_draw_sw_grad_radial_setup— paramdsclv_draw_sw_grad_radial_cleanup— paramdsclv_draw_sw_grad_radial_get_line— paramdsclv_draw_sw_grad_conical_setup— paramdsclv_draw_sw_grad_conical_cleanup— paramdsclv_draw_sw_grad_conical_get_line— paramdsclv_vg_lite_draw_grad_helper— paramgrad_dsclv_grad_init_stops— paramgradlv_grad_horizontal_init— paramdsclv_grad_vertical_init— paramdsclv_grad_linear_init— paramdsclv_grad_radial_init— paramdsclv_grad_radial_set_focal— paramdsclv_grad_conical_init— paramdsclv_style_set_bg_grad— paramvalue
Dependencies
How is this guide?
Last updated on