From 1cb170664efbc013df73d70f3058e6cda9443941 Mon Sep 17 00:00:00 2001 From: Hel Gibbons <50950368+helgibbons@users.noreply.github.com> Date: Tue, 28 Feb 2023 15:16:08 +0000 Subject: [PATCH 1/2] PicoGraphics: correct hsv pen reference --- micropython/modules/picographics/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/micropython/modules/picographics/README.md b/micropython/modules/picographics/README.md index 159bb9c8..17ccb905 100644 --- a/micropython/modules/picographics/README.md +++ b/micropython/modules/picographics/README.md @@ -170,6 +170,12 @@ In RGB565 and RGB332 modes this packs the given RGB into an integer representing In P4 and P8 modes this will consume one palette entry, or return an error if your palette is full. Palette colours are stored as RGB and converted when they are displayed on screen. +You can also now specify an HSV pen, which allows a pen to be created from HSV (Hue, Saturation, Value) values, avoiding the need to calculate the RGB result in Python. + +```python +display.create_pen_hsv(h, s, v) +``` + To tell PicoGraphics which pen to use: ```python @@ -178,12 +184,6 @@ display.set_pen(my_pen) This will be either an RGB332, RGB565 or RGB888 colour, or a palette index. -As of v1.19.14 you can also specify an HSV pen, which allows a pen to be created from HSV (Hue, Saturation, Value) values, avoiding the need to calculate the RGB result in Python. - -```python -display.set_pen_hsv(h, s, v) -``` - ##### Monochrome Modes For 1BIT mode - such as for Inky Pack and the Mono OLED - pens are handled a little differently. From 5ca10794a8b38b6c8ba178097126d5fb816d50e0 Mon Sep 17 00:00:00 2001 From: Hel Gibbons <50950368+helgibbons@users.noreply.github.com> Date: Tue, 28 Feb 2023 15:43:19 +0000 Subject: [PATCH 2/2] PicoGraphics: clarify hsv units --- micropython/modules/picographics/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/micropython/modules/picographics/README.md b/micropython/modules/picographics/README.md index 17ccb905..cb42579d 100644 --- a/micropython/modules/picographics/README.md +++ b/micropython/modules/picographics/README.md @@ -170,7 +170,7 @@ In RGB565 and RGB332 modes this packs the given RGB into an integer representing In P4 and P8 modes this will consume one palette entry, or return an error if your palette is full. Palette colours are stored as RGB and converted when they are displayed on screen. -You can also now specify an HSV pen, which allows a pen to be created from HSV (Hue, Saturation, Value) values, avoiding the need to calculate the RGB result in Python. +You can also now specify an HSV pen, which allows a pen to be created from HSV (Hue, Saturation, Value) values between 0.0 and 1.0, avoiding the need to calculate the RGB result in Python. ```python display.create_pen_hsv(h, s, v)