diff options
| author | Matt Land <matt-land@users.noreply.github.com> | 2019-05-14 08:03:34 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-14 08:03:34 -0500 |
| commit | 0b1c1c1d929352c9995bcb1e58e90309d89b9d38 (patch) | |
| tree | c227cbc8a8e6a46e5e3a228502058b8d257d920b | |
| parent | ad211b23be17ed058ca686644d5e2323a005d0a4 (diff) | |
Update Palette.c
Remove None, add in byte and bytearray examples
| -rw-r--r-- | shared-bindings/displayio/Palette.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c index 90fd9bf52..11c2f677c 100644 --- a/shared-bindings/displayio/Palette.c +++ b/shared-bindings/displayio/Palette.c @@ -70,14 +70,15 @@ STATIC mp_obj_t displayio_palette_make_new(const mp_obj_type_t *type, size_t n_a //| //| Sets the pixel color at the given index. The index should be an integer in the range 0 to color_count-1. //| -//| The value argument represents a color, and can be from 0x000000 to 0xFFFFFF (to represent an RGB value), -//| or None to represent transparency. Value can be an int or bytes (3 bytes (RGB) or 4 bytes (RGB + pad byte)). +//| The value argument represents a color, and can be from 0x000000 to 0xFFFFFF (to represent an RGB value). +//| Value can be an int, bytes (3 bytes (RGB) or 4 bytes (RGB + pad byte)), or bytearray. //| //| This allows you to:: //| -//| palette[0] = 0xFFFFFF -//| palette[1] = 0xFF0000 -//| palette[2] = None # transparency +//| palette[0] = 0xFFFFFF # set using an integer +//| palette[1] = b'\xff\xff\x00' # set using 3 bytes +//| palette[2] = b'\xff\xff\x00\x00' # set using 4 bytes +//| palette[3] = bytearray(b'\x00\x00\xFF') # set using a bytearay of 3 or 4 bytes //| STATIC mp_obj_t palette_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value) { if (value == MP_OBJ_NULL) { |
