From 935b4016a3705b4717fa19b2e24f676ac760135f Mon Sep 17 00:00:00 2001 From: Victor Wheeler Date: Tue, 7 Jan 2025 06:01:33 -0700 Subject: [PATCH] fix(docs): clarify how to pass color index... (#7554) --- docs/details/widgets/canvas.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/details/widgets/canvas.rst b/docs/details/widgets/canvas.rst index eb9f03e44..8e8a2e209 100644 --- a/docs/details/widgets/canvas.rst +++ b/docs/details/widgets/canvas.rst @@ -61,7 +61,8 @@ Drawing To set an individual pixel's color on the Canvas, use :cpp:expr:`lv_canvas_set_px(canvas, x, y, color, opa)`. With indexed color formats -(``LV_COLOR_FORMAT_I1/2/4/8``) pass the color index as the ``color`` argument. +(``LV_COLOR_FORMAT_I1/2/4/8``) pass the color index as the ``color`` argument by using +the *blue* channel in the ``color`` value, e.g. :cpp:expr:`lv_color_make(0, 0, index)`. :cpp:expr:`lv_canvas_fill_bg(canvas, lv_color_hex(0x00ff00), LV_OPA_50)` fills the whole Canvas to blue with 50% opacity. Note that if the current color format