pdwidgets.widgets.icon

Icon display widget.

class pdwidgets.widgets.icon.Icon(parent, x=0, y=0, w=None, h=None, align=None, align_to=None, fg=None, bg=None, visible=True, value=None, padding=None, chroma=None)[source]

Bases: Widget

Monochrome or RGB565 icon display.

load_icon(value)[source]

Load icon asset, cache it, and record whether it is a color asset.

changed()[source]

Update the icon when the value changes.

draw(_=None)[source]

Draw the icon on the screen.

Color (RGB565) icons are blitted directly (with chroma as the transparent key when set); monochrome icons are recolored to fg/bg via the shared 2-entry palette buffer.