get_material_design

typhon.plots.get_material_design(name, shade=None)[source]

Return material design colors.

Parameters:
  • name (str) – Color name (e.g. ‘red’).

  • shade (str) – Color shade (e.g. ‘500’). If None all defined shades are returned.

Returns:

Hex RGB value or list of hex RGB values.

Return type:

str or list[str]

References

https://material.io/design/color/the-color-system.html

Raises:

ValueError – If the specified name or shade is not defined.

Examples

>>> get_material_design('red', shade='500')
'#F44336'
>>> get_material_design('red')
['#FFEBEE', '#FFCDD2', '#EF9A9A', '#E57373', '#EF5350', '#F44336',
'#E53935', '#D32F2F', '#C62828', '#B71C1C', '#FF8A80', '#FF5252',
'#FF1744', '#D50000']