lv_color_op.h

API reference for lv_color_op.h

Report on GitHub
See Also: Private HeaderThis header has a companion private implementation with internal data structures.lv_color_op_private.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)
Parameters
NameTypeDescription
c1lv_color_tthe first color to mix (usually the foreground)
c2lv_color_tthe second color to mix (usually the background)
mixuint8_tThe 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)
Parameters

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)
Parameters
NameTypeDescription
fglv_color32_tThe foreground color in premultiplied ARGB8888 format.
bglv_color32_tThe 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)
Parameters
NameTypeDescription
clv_color_ta 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)
Parameters

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)
Parameters
NameTypeDescription
fglv_color32_tthe foreground color
bglv_color32_tthe background color

Returns: lv_color32_t — result color

Structs

struct

_lv_color_filter_dsc_t

MemberTypeDescription
filter_cblv_color_filter_cb_t
user_datavoid *

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 — param cb

Dependencies

How is this guide?

Last updated on

On this page