lv_color_op.h
API reference for lv_color_op.h
Functions
lv_color_mix
Mix two colors with a given ratio.
lv_color_t lv_color_mix(lv_color_t c1, lv_color_t c2, uint8_t mix)| Name | Type | Description |
|---|---|---|
c1 | lv_color_t | the first color to mix (usually the foreground) |
c2 | lv_color_t | the second color to mix (usually the background) |
mix | uint8_t | The ratio of the colors. 0: full c2, 255: full c1, 127: half c1 and halfc2 |
Returns: lv_color_t — the mixed color
lv_color_mix32
lv_color32_t lv_color_mix32(lv_color32_t fg, lv_color32_t bg)| Name | Type |
|---|---|
fg | lv_color32_t |
bg | lv_color32_t |
Use bg.alpha in the return value
Use fg.alpha as mix ratio
lv_color_mix32_premultiplied
Blends two premultiplied ARGB8888 colors while maintaining correct alpha compositing.
This function correctly blends the foreground (fg) and background (bg) colors, ensuring that the output remains in a premultiplied alpha format.
lv_color32_t lv_color_mix32_premultiplied(lv_color32_t fg, lv_color32_t bg)| Name | Type | Description |
|---|---|---|
fg | lv_color32_t | The foreground color in premultiplied ARGB8888 format. |
bg | lv_color32_t | The background color in premultiplied ARGB8888 format. |
Returns: lv_color32_t — The resulting blended color in premultiplied ARGB8888 format.
If the foreground is fully opaque, it is returned as is.
If the foreground is fully transparent, the background is returned.
lv_color_brightness
Get the brightness of a color
uint8_t lv_color_brightness(lv_color_t c)| Name | Type | Description |
|---|---|---|
c | lv_color_t | a color |
Returns: uint8_t — brightness in range [0..255]
lv_color_filter_dsc_init
void lv_color_filter_dsc_init(lv_color_filter_dsc_t *dsc, lv_color_filter_cb_t cb)| Name | Type |
|---|---|
dsc | lv_color_filter_dsc_t * |
cb | lv_color_filter_cb_t |
lv_color_over32
Blend two colors that have not been pre-multiplied using their alpha values
lv_color32_t lv_color_over32(lv_color32_t fg, lv_color32_t bg)| Name | Type | Description |
|---|---|---|
fg | lv_color32_t | the foreground color |
bg | lv_color32_t | the background color |
Returns: lv_color32_t — result color
Structs
_lv_color_filter_dsc_t
| Member | Type | Description |
|---|---|---|
filter_cb | lv_color_filter_cb_t | |
user_data | void * |
Typedefs
lv_color_filter_cb_t
typedef lv_color_t(* lv_color_filter_cb_t) (const struct _lv_color_filter_dsc_t *, lv_color_t, lv_opa_t)Used by 1 function
lv_color_filter_dsc_init— paramcb
Dependencies
How is this guide?
Last updated on