Skip to content

Commit 0b1c1c1

Browse files
authored
Update Palette.c
Remove None, add in byte and bytearray examples
1 parent ad211b2 commit 0b1c1c1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

shared-bindings/displayio/Palette.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,15 @@ STATIC mp_obj_t displayio_palette_make_new(const mp_obj_type_t *type, size_t n_a
7070
//|
7171
//| Sets the pixel color at the given index. The index should be an integer in the range 0 to color_count-1.
7272
//|
73-
//| The value argument represents a color, and can be from 0x000000 to 0xFFFFFF (to represent an RGB value),
74-
//| or None to represent transparency. Value can be an int or bytes (3 bytes (RGB) or 4 bytes (RGB + pad byte)).
73+
//| The value argument represents a color, and can be from 0x000000 to 0xFFFFFF (to represent an RGB value).
74+
//| Value can be an int, bytes (3 bytes (RGB) or 4 bytes (RGB + pad byte)), or bytearray.
7575
//|
7676
//| This allows you to::
7777
//|
78-
//| palette[0] = 0xFFFFFF
79-
//| palette[1] = 0xFF0000
80-
//| palette[2] = None # transparency
78+
//| palette[0] = 0xFFFFFF # set using an integer
79+
//| palette[1] = b'\xff\xff\x00' # set using 3 bytes
80+
//| palette[2] = b'\xff\xff\x00\x00' # set using 4 bytes
81+
//| palette[3] = bytearray(b'\x00\x00\xFF') # set using a bytearay of 3 or 4 bytes
8182
//|
8283
STATIC mp_obj_t palette_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value) {
8384
if (value == MP_OBJ_NULL) {

0 commit comments

Comments
 (0)