From 4124ecf275abfcc573ff63ff484a9aef375e03a2 Mon Sep 17 00:00:00 2001 From: fleur <spacecarrot@fleurshax.net> Date: Fri, 6 Sep 2019 17:59:59 +0200 Subject: [PATCH] added docs for transparent bg printing on display and changed it to default in pycardium --- epicardium/epicardium.h | 2 +- pycardium/modules/py/display.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/epicardium/epicardium.h b/epicardium/epicardium.h index 2428cb58..74ad1a26 100644 --- a/epicardium/epicardium.h +++ b/epicardium/epicardium.h @@ -1347,7 +1347,7 @@ enum disp_font_name { * :param posy: y position to print to. 0 <= y <= 80 * :param pString: string to print * :param fg: foreground color in rgb565 - * :param bg: background color in rgb565 + * :param bg: background color in rgb565, no background is drawn if bg==fg * :return: ``0`` on success or a negative value in case of an error: * * - ``-EBUSY``: Display was already locked from another task. diff --git a/pycardium/modules/py/display.py b/pycardium/modules/py/display.py index ef9cc87e..3811d55d 100644 --- a/pycardium/modules/py/display.py +++ b/pycardium/modules/py/display.py @@ -74,7 +74,7 @@ class Display: :param text: Text to print :param fg: Foreground color (expects RGB triple) - :param bg: Background color (expects RGB triple) + :param bg: Background color (expects RGB triple) or None for transparent background :param posx: X-Position of the first character, 0 <= posx <= 159 :param posy: Y-Position of the first character, 0 <= posy <= 79 :param font: 0 <= font <= 4 (currently) selects a font @@ -97,7 +97,7 @@ class Display: d.update() """ fg = fg or color.WHITE - bg = bg or color.BLACK + bg = bg or fg sys_display.print_adv(text, posx, posy, fg, bg, font) return self -- GitLab