sid.colors
¶
Copied from the utilities package from the Covid Impact Lab.
https://github.com/covid-19-impact-lab/utilities/blob/master/utilities/colors.py.””
Module Contents¶
Functions¶
|
Return a list with hex codes representing a color palette. |
|
|
|
Plot a color palette. |
|
Attributes¶
- get_colors(palette, number, as_cmap=False, skip_dark=0, skip_bright=0)[source]¶
Return a list with hex codes representing a color palette.
- Parameters
palette (str) – One of [“categorical”, “ordered”, “blue”, “red”, “yellow”, “green”, “orange”, “purple”] or combinations of two colors, e.g. “red-green”.
number (int) – Number of colors needed. Between 1 and 12 for non combined color scales and between 1 and 24 for combined color scales.
as_cmap (bool) – If True, the result is returned as matplotlib cmap.
skip_dark (int) – How many colors to skip from the dark side. Only available for monochrome and combined color palettes.
skip_bright (int) – How many colors to skip from the bright side. Only available for monochrome and combined color palettes.
- Returns
List of hex codes or cmap.
- Return type
list or cmap