Skip to content

displayio.Palette not checking color_count #1671

@caternuson

Description

@caternuson

Can instantiate a Palette with a color_count that exceeds max (255?) without getting any errors. But then it errors out later.

Adafruit CircuitPython 4.0.0-beta.5 on 2019-03-17; Adafruit PyPortal with samd51j20
>>> from displayio import Palette
>>> p1 = Palette(255)
>>> p2 = Palette(256)
>>> p1[0] = 0xFF0000
>>> p2[0] = 0xFF0000
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IndexError: Palette index out of range
>>> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions