lv_color_op.h

Typedefs

typedef lv_color_t (*lv_color_filter_cb_t)(const struct _lv_color_filter_dsc_t*, lv_color_t, lv_opa_t)
typedef struct _lv_color_filter_dsc_t lv_color_filter_dsc_t

Functions

static inline lv_color_t lv_color_mix(lv_color_t c1, lv_color_t c2, uint8_t mix)

Mix two colors with a given ratio.

Parameters:
  • c1 -- the first color to mix (usually the foreground)

  • c2 -- the second color to mix (usually the background)

  • mix -- The ratio of the colors. 0: full c2, 255: full c1, 127: half c1 and halfc2

Returns:

the mixed color

static inline lv_color32_t lv_color_mix32(lv_color32_t fg, lv_color32_t bg)

Note

Use bg.alpha in the return value

Note

Use fg.alpha as mix ratio

Parameters:
  • fg --

  • bg --

Returns:

static inline uint8_t lv_color_brightness(lv_color_t c)

Get the brightness of a color

Parameters:

color -- a color

Returns:

the brightness [0..255]

static inline void lv_color_filter_dsc_init(lv_color_filter_dsc_t *dsc, lv_color_filter_cb_t cb)
struct _lv_color_filter_dsc_t

Public Members

lv_color_filter_cb_t filter_cb
void *user_data