Source code for suboptimumg.plotting.color_themes

COLOR_THEMES = {
    "aero": {
        "colorscale": "Purples",
        "dark": "#4A148C",
        "light": "rgba(142, 68, 173, 0.7)",
    },
    "suspension": {
        "colorscale": "Viridis",
        "dark": "#440154",
        "light": "#21908C",
    },  # Blue-green to yellow
    "chassis": {
        "colorscale": "Blues",
        "dark": "#2B4F81",
        "light": "rgba(76, 114, 176, 0.7)",
    },
    "dri": {
        "colorscale": "Plasma",
        "dark": "#0D0887",
        "light": "#CC4778",
    },  # Deep blue to yellow-red
    "powertrain": {
        "colorscale": "Inferno",
        "dark": "#000004",
        "light": "#BB3754",
    },  # Black to yellow
    "accumulator": {
        "colorscale": "Magma",
        "dark": "#000004",
        "light": "#B63679",
    },  # Black to light pink
    "cividis": {
        "colorscale": "Cividis",
        "dark": "#00204D",
        "light": "#7B7B78",
    },  # Blue to yellow, colorblind friendly
    "green": {
        "colorscale": "Greens",
        "dark": "#1B5E20",
        "light": "rgba(46, 204, 113, 0.7)",
    },
    "red": {"colorscale": "Reds", "dark": "#7F0000", "light": "rgba(231, 76, 60, 0.7)"},
    "orange": {
        "colorscale": "Oranges",
        "dark": "#803E00",
        "light": "rgba(243, 156, 18, 0.7)",
    },
    "copper_teal": {
        "colorscale": "BrBG",  # Brown to Blue-Green
        "dark": "#543005",
        "light": "#003C30",
    },
    "thermal": {
        "colorscale": "Thermal",  # Dark red to yellow
        "dark": "#4B0C6B",
        "light": "#FCE625",
    },
    "matter": {
        "colorscale": "matter",  # Dark blue to yellow
        "dark": "#1A237E",
        "light": "#FFD600",
    },
    "rdbu": {
        "colorscale": "RdBu",  # Red to white to blue
        "dark": "#67001F",
        "light": "#053061",
    },
    "chart_default": {
        "colorscale": "RdBu_r",  # Blue to white to red
        "dark": "#053061",
        "light": "#67001F",
    },
}

# Default theme to use if none specified
DEFAULT_THEME = "cividis"


[docs] def get_theme(theme_name=None): """ Get a color theme by name. Parameters ---------- theme_name : str, optional Name of the theme to get. If None, returns the default theme. Returns ------- dict The color theme dictionary """ if theme_name is None: return COLOR_THEMES[DEFAULT_THEME] if theme_name not in COLOR_THEMES: print( f"Warning: Theme '{theme_name}' not found, using default theme '{DEFAULT_THEME}'" ) return COLOR_THEMES[DEFAULT_THEME] return COLOR_THEMES[theme_name]