Skip to content

material_design

palettes.material_design

palettes.material_design

This module contains the Material Design color palette as a class object.

Usage

from palettes import get_palette palette = get_palette(name="material_design", color_depth=16, swapped=False)

OR

palette = get_palette("material_design")

OR

from palettes.material_design import MDPalette palette = MDPalette(size=5, color_depth=24)

to access the primary variant of a color family by name:

x = palette.RED x = palette.BLACK

to access all 256 colors directly:

x = palette[127] # color at index 127

to access a shade by name:

x = palette.RED_S500 # shade 500 x = palette.RED_S900 # shade 900 x = palette.RED_S50 # shade 50

to access an accent of a color family by name:

x = palette.RED_A100 x = palette.RED_A700

to iterate over all 256 colors:

for x in palette:
    pass

Classes

MDPalette

MDPalette(name='', color_depth=16, swapped=False, color_map=COLORS)

A class to represent the Material Design color palette.

Methods:
color_rgb
color_rgb(color)

color can be an 16-bit integer or a tuple, list or bytearray of length 2 or 3.