Skip to content

fontlabapp.qt.colors · declarations 001

Back to fontlabapp.qt.colors

color_palette

color_palette(gui: Any, widget: Callable[[], Any], convert: Callable[[], Any] | None, role: Callable[[Any], Any]) -> Any

Reset with a default palette or mutate the current palette once.

Caller selects the role, converts its color and applies the resulting palette/autofill in its original order. None never reads widget or role. Read role before setter lookup; convert only after that lookup succeeds.

group_box_style

group_box_style(fill: Callable[[], str] | None, border: Callable[[], str] | None, width: Any, radius: Any) -> str | None

Build optional ordered rules; no options means no stylesheet write.

Color suppliers run only for their declared rule, retaining width/color and radius evaluation order. Callers retain their color-object conversion.

rgba255

rgba255(channels: Iterable[float]) -> tuple[int, ...]

Scale and banker's-round every channel without introducing clamping.

rgba_css

rgba_css(channels: Iterable[float]) -> str

Format four channels; original unpack stops after the fifth on overflow.

Do not materialize the iterable: later values may raise or never terminate.

swatch_style

swatch_style(channels: Iterable[int]) -> str

Format a button swatch from already rounded channels.