Skip to content

Commit ad211b2

Browse files
authored
add documentation of transparency
1 parent 214dfed commit ad211b2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

shared-bindings/displayio/Palette.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,16 @@ STATIC mp_obj_t displayio_palette_make_new(const mp_obj_type_t *type, size_t n_a
6868
}
6969
//| .. method:: __setitem__(index, value)
7070
//|
71-
//| Sets the pixel color at the given index. The index should be an integer in the range 0 to color_count-1
71+
//| 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 color can be from 0x000000 to 0xFFFFFF, and 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+
//| or None to represent transparency. Value can be an int or bytes (3 bytes (RGB) or 4 bytes (RGB + pad byte)).
7475
//|
7576
//| This allows you to::
7677
//|
7778
//| palette[0] = 0xFFFFFF
7879
//| palette[1] = 0xFF0000
80+
//| palette[2] = None # transparency
7981
//|
8082
STATIC mp_obj_t palette_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value) {
8183
if (value == MP_OBJ_NULL) {

0 commit comments

Comments
 (0)