Skip to content

colors

A named Max color palette, a resolve_color() helper, and box THEMES used by Patcher.apply_theme(). Colors are Max [r, g, b, a] floats (0..1); inputs may be a name ("red"), hex ("#ff8800"), or a float sequence.

p.add_textbox('toggle').set_color(bg='blue', text='white')
p.apply_theme('dark')   # 'light' | 'dark' | 'blue' | 'high-contrast'

Named Max colors, color resolution, and box themes.

Max stores colors as [r, g, b, a] float lists in the 0..1 range. These helpers let callers use friendly names ("red"), hex strings ("#ff8800"), or raw float sequences interchangeably when styling boxes.

resolve_color

resolve_color(color: ColorLike) -> List[float]

Resolve a color to a Max [r, g, b, a] float list.

Accepts a named color (see MAX_COLORS), a hex string ("#rrggbb" or "#rrggbbaa"), or an [r, g, b] / [r, g, b, a] sequence of floats.