palettes.material_design

Material Design color palette.

256 swatches from the Material Design spec, exposed as indexed colors and named attributes. Each hue family includes shades S50–S900; most families also provide accent colors A100, A200, A400, and A700.

Example

>>> from palettes import get_palette
>>> palette = get_palette(name="material_design", color_depth=16)
>>> palette.RED
>>> palette.RED_S900
>>> palette[127]
class palettes.material_design.MDPalette(name='', color_depth=16, swapped=False, color_map=<memory>)[source]

Bases: MappedPalette

Material Design swatch palette.

This palette is a good fit for UI theming and semantic color choices such as surfaces, accents, success/error states, and status chips. The generated named attributes make it easy to pick an icon, badge, or button color that matches the Material Design system without manually looking up hex values.

Colors are stored in a flat RGB map. During initialization, named attributes are created for each family and shade (for example RED, RED_S500, RED_A700). The unsuffixed name always refers to the S500 primary shade.

Parameters:
  • name (str) – Label for name; defaults to "MaterialDesign" when empty.

  • color_depth (int) – Output format; see Palette.

  • swapped (bool) – Byte-swap 16-bit colors when True.

  • color_map (bytes) – RGB byte map; defaults to the built-in Material Design table.