Implementation:Evidentlyai Evidently Legacy Color Options
| Knowledge Sources | |
|---|---|
| Domains | ML Monitoring, Visualization, Configuration |
| Last Updated | 2026-02-14 12:00 GMT |
Overview
ColorOptions defines a configurable color scheme for all data visualizations in Evidently legacy reports, with several pre-built theme presets.
Description
The ColorOptions class extends Option and provides a comprehensive collection of color settings used throughout the Evidently visualization system. It controls colors for:
- primary_color -- basic color for data visualization, used by default for all bars/lines and current data (default:
#ed0400, red) - secondary_color -- color for second data set, e.g., reference data (default:
#4d4d4d, grey) - current_data_color -- explicit color override for current data (defaults to primary_color if None)
- reference_data_color -- explicit color override for reference data (defaults to secondary_color if None)
- additional_data_color -- color for additional data series (default:
#0a5f38) - color_sequence -- sequence of colors for multi-line graphs (default: 6-color discrete palette)
- fill_color -- fill color for areas in line graphs (default:
LightGreen) - zero_line_color -- color for zero/base line (default:
green) - non_visible_color -- technical dots for scalability (default:
white) - underestimation_color -- regression underestimation (default:
#6574f7) - overestimation_color -- regression overestimation (default:
#ee5540) - majority_color -- regression majority (default:
#1acc98) - vertical_lines -- vertical line color (default:
green) - heatmap -- heatmap colorscale name (default:
RdBu_r)
Helper methods:
- get_current_data_color() -- returns
current_data_colorif set, otherwiseprimary_color - get_reference_data_color() -- returns
reference_data_colorif set, otherwisesecondary_color
The module also provides four pre-built color theme constants:
- SOLARIZED_COLOR_OPTIONS -- blue/teal theme inspired by the Solarized palette
- KARACHI_SUNRISE_COLOR_OPTIONS -- black/gold/green theme
- BERLIN_AUTUMN_COLOR_OPTIONS -- purple/orange theme
- NIGHTOWL_COLOR_OPTIONS -- dark blue/red/amber theme
Module-level constants RED and GREY are used as default primary and secondary colors. COLOR_DISCRETE_SEQUENCE provides the default 6-color discrete palette.
Usage
Use ColorOptions to customize the appearance of Evidently report visualizations. Select a pre-built theme or create a custom one by overriding individual color fields.
Code Reference
Source Location
- Repository: Evidentlyai_Evidently
- File:
src/evidently/legacy/options/color_scheme.py
Signature
RED = "#ed0400"
GREY = "#4d4d4d"
COLOR_DISCRETE_SEQUENCE = ["#ed0400", "#0a5f38", "#6c3461", "#71aa34", "#d8dcd6", "#6b8ba4"]
class ColorOptions(Option):
primary_color: str = RED
secondary_color: str = GREY
current_data_color: Optional[str] = None
reference_data_color: Optional[str] = None
additional_data_color: str = "#0a5f38"
color_sequence: Sequence[str] = COLOR_DISCRETE_SEQUENCE
fill_color: str = "LightGreen"
zero_line_color: str = "green"
non_visible_color: str = "white"
underestimation_color: str = "#6574f7"
overestimation_color: str = "#ee5540"
majority_color: str = "#1acc98"
vertical_lines: str = "green"
heatmap: str = "RdBu_r"
def get_current_data_color(self): ...
def get_reference_data_color(self): ...
SOLARIZED_COLOR_OPTIONS = ColorOptions(...)
KARACHI_SUNRISE_COLOR_OPTIONS = ColorOptions(...)
BERLIN_AUTUMN_COLOR_OPTIONS = ColorOptions(...)
NIGHTOWL_COLOR_OPTIONS = ColorOptions(...)
Import
from evidently.legacy.options.color_scheme import ColorOptions
from evidently.legacy.options.color_scheme import SOLARIZED_COLOR_OPTIONS
from evidently.legacy.options.color_scheme import KARACHI_SUNRISE_COLOR_OPTIONS
from evidently.legacy.options.color_scheme import BERLIN_AUTUMN_COLOR_OPTIONS
from evidently.legacy.options.color_scheme import NIGHTOWL_COLOR_OPTIONS
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| primary_color | str |
No | Primary visualization color. Default: #ed0400.
|
| secondary_color | str |
No | Secondary visualization color. Default: #4d4d4d.
|
| current_data_color | Optional[str] |
No | Override color for current data. Falls back to primary_color. |
| reference_data_color | Optional[str] |
No | Override color for reference data. Falls back to secondary_color. |
| color_sequence | Sequence[str] |
No | Color sequence for multi-line plots. |
| fill_color | str |
No | Fill color for areas. Default: LightGreen.
|
| underestimation_color | str |
No | Color for underestimation in regression. Default: #6574f7.
|
| overestimation_color | str |
No | Color for overestimation in regression. Default: #ee5540.
|
| heatmap | str |
No | Heatmap colorscale name. Default: RdBu_r.
|
Outputs
| Name | Type | Description |
|---|---|---|
| ColorOptions | ColorOptions |
A color configuration object that can be passed to reports and renderers via the Options container. |
Usage Examples
from evidently.legacy.options.color_scheme import ColorOptions, SOLARIZED_COLOR_OPTIONS
from evidently.legacy.options.base import Options
# Use a pre-built color theme
options = Options(color=SOLARIZED_COLOR_OPTIONS)
# Create a custom color scheme
custom_colors = ColorOptions(
primary_color="#1f77b4",
secondary_color="#ff7f0e",
heatmap="viridis",
)
options = Options(color=custom_colors)
# Access resolved colors
print(custom_colors.get_current_data_color()) # "#1f77b4" (falls back to primary)
print(custom_colors.get_reference_data_color()) # "#ff7f0e" (falls back to secondary)