midlearn.color_theme
- class midlearn.color_theme(theme: str | list[str] | color_theme, theme_type: Literal['diverging', 'qualitative', 'sequential'] | None = None, **kwargs)[source]
Color themes for graphics.
- __init__(theme: str | list[str] | color_theme, theme_type: Literal['diverging', 'qualitative', 'sequential'] | None = None, **kwargs)[source]
Initialize color theme object
- Parameters:
theme (str or list of str or color_theme) – The name of the theme (str), a list of custom colors (list[str]), or an existing color_theme object.
theme_type ({'diverging', 'qualitative', 'sequential'}, default 'sequential') – The type of the color theme.
**kwargs (dict) – Additional keyword arguments passed to the midr::color.theme() function in R.
Methods
__init__(theme[, theme_type])Initialize color theme object
palette(n)Return a list of colors of specified length.
ramp(x)Return a list of colors based on the specified list of values.