Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions adafruit_display_text/bitmap_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ class Label(LabelBase):
:param int outline_size: The size in pixels of the outline stroke.
Defaults to 1 pixel.
:param Optional[displayio.Palette] color_palette: The palette to use for the Label.
Indexes 0, 1, and 2 will be filled with background, foreground, and outline colors
automatically. Indexes 3 and above can be used for accent colors.
:param Optional[int] max_characters: The number of characters that sets the fixed-width.
Indexes 0, 1, and 2 will be used for background, foreground, and outline colors
respectively. Indexes 3 and above can be used for accent colors. ``color``,
``background_color``, and ``outline_color`` arguments will be ignored if
``color_palette`` is used.
:param Optional[int] ax_characters: The number of characters that sets the fixed-width.
Default is None for unlimited width and no scrolling

:param float animate_time: The number of seconds in between scrolling animation
Expand Down Expand Up @@ -173,8 +175,6 @@ def __init__(
"using accents."
)
self._palette = color_palette
self.color = self._color
self.background_color = self._background_color
else:
_background_color = self._palette[0]
_foreground_color = self._palette[1]
Expand Down
4 changes: 3 additions & 1 deletion examples/display_text_accent_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
main_group = displayio.Group()

accent_palette = displayio.Palette(6)
accent_palette[1] = 0xAAAAAA
accent_palette[2] = 0x000000
accent_palette[3] = 0xDDDD00
accent_palette[4] = 0xFFFFFF
accent_palette[5] = 0x652F8F
accent_palette.make_transparent(0)

accent_lbl = Label(terminalio.FONT, color_palette=accent_palette, text="", color=0xAAAAAA)
accent_lbl = Label(terminalio.FONT, color_palette=accent_palette, text="")
accent_lbl.anchor_point = (0, 0)
accent_lbl.anchored_position = (4, 4)
main_group.append(accent_lbl)
Expand Down
3 changes: 2 additions & 1 deletion examples/display_text_accent_scrolling_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@
text = "Hello world CircuitPython Labels are awesome!"

accent_palette = displayio.Palette(7)
accent_palette[1] = 0xAAAAAA
accent_palette[3] = 0x3774A7
accent_palette[4] = 0xFFD748
accent_palette[5] = 0xFFFFFF
accent_palette[6] = 0x652F8F
accent_palette.make_transparent(0)

scrolling_label = Label(
terminalio.FONT,
text=text,
max_characters=20,
animate_time=0.3,
color_palette=accent_palette,
color=0xAAAAAA,
scale=2,
)

Expand Down