feat(theme): add tone mapping and fix missing palette colors
This commit is contained in:
+33
-3
@@ -9,19 +9,20 @@ from typing import Any
|
||||
VALID_SYNTAX_PALETTES: tuple[str, ...] = ("dark", "light", "mariana", "retro_blue")
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass
|
||||
class ThemePalette:
|
||||
window_bg: tuple[int, int, int] = (0, 0, 0)
|
||||
text: tuple[int, int, int] = (200, 200, 200)
|
||||
text_disabled: tuple[int, int, int] = (130, 130, 130)
|
||||
child_bg: tuple[int, int, int] = (0, 0, 0)
|
||||
popup_bg: tuple[int, int, int] = (0, 0, 0)
|
||||
border: tuple[int, int, int] = (60, 60, 60)
|
||||
border_shadow: tuple[int, int, int] = (0, 0, 0)
|
||||
frame_bg: tuple[int, int, int] = (45, 45, 45)
|
||||
frame_bg_hovered: tuple[int, int, int] = (60, 60, 60)
|
||||
frame_bg_active: tuple[int, int, int] = (75, 75, 75)
|
||||
title_bg: tuple[int, int, int] = (40, 40, 40)
|
||||
title_bg_active: tuple[int, int, int] = (60, 45, 15)
|
||||
title_bg_collapsed: tuple[int, int, int] = (30, 30, 30)
|
||||
menu_bar_bg: tuple[int, int, int] = (35, 35, 35)
|
||||
scrollbar_bg: tuple[int, int, int] = (30, 30, 30)
|
||||
scrollbar_grab: tuple[int, int, int] = (80, 80, 80)
|
||||
@@ -39,11 +40,40 @@ class ThemePalette:
|
||||
separator: tuple[int, int, int] = (60, 60, 60)
|
||||
separator_hovered: tuple[int, int, int] = (100, 100, 100)
|
||||
separator_active: tuple[int, int, int] = (200, 200, 200)
|
||||
resize_grip: tuple[int, int, int] = (60, 60, 60)
|
||||
resize_grip_hovered: tuple[int, int, int] = (100, 100, 100)
|
||||
resize_grip_active: tuple[int, int, int] = (200, 200, 200)
|
||||
tab: tuple[int, int, int] = (60, 60, 60)
|
||||
tab_hovered: tuple[int, int, int] = (100, 100, 100)
|
||||
tab_selected: tuple[int, int, int] = (100, 100, 100)
|
||||
tab_dimmed: tuple[int, int, int] = (60, 60, 60)
|
||||
tab_dimmed_selected: tuple[int, int, int] = (100, 100, 100)
|
||||
docking_preview: tuple[int, int, int] = (100, 100, 100)
|
||||
docking_empty_bg: tuple[int, int, int] = (20, 20, 20)
|
||||
text: tuple[int, int, int] = (200, 200, 200)
|
||||
text_disabled: tuple[int, int, int] = (130, 130, 130)
|
||||
text_selected_bg: tuple[int, int, int] = (60, 100, 150)
|
||||
table_header_bg: tuple[int, int, int] = (55, 55, 55)
|
||||
table_border_strong: tuple[int, int, int] = (60, 60, 60)
|
||||
table_border_light: tuple[int, int, int] = (40, 40, 40)
|
||||
table_row_bg: tuple[int, int, int] = (0, 0, 0)
|
||||
table_row_bg_alt: tuple[int, int, int] = (10, 10, 10)
|
||||
nav_cursor: tuple[int, int, int] = (100, 100, 100)
|
||||
nav_windowing_dim_bg: tuple[int, int, int] = (20, 20, 20)
|
||||
nav_windowing_highlight: tuple[int, int, int] = (200, 200, 200)
|
||||
modal_window_dim_bg: tuple[int, int, int] = (10, 10, 10)
|
||||
plot_lines: tuple[int, int, int] = (100, 100, 100)
|
||||
plot_lines_hovered: tuple[int, int, int] = (200, 100, 100)
|
||||
plot_histogram: tuple[int, int, int] = (100, 100, 100)
|
||||
plot_histogram_hovered: tuple[int, int, int] = (200, 100, 100)
|
||||
drag_drop_target: tuple[int, int, int] = (200, 200, 0)
|
||||
drag_drop_target_bg: tuple[int, int, int] = (0, 0, 0)
|
||||
input_text_cursor: tuple[int, int, int] = (200, 200, 200)
|
||||
tab_dimmed_selected_overline: tuple[int, int, int] = (100, 100, 100)
|
||||
tab_selected_overline: tuple[int, int, int] = (100, 100, 100)
|
||||
text_link: tuple[int, int, int] = (60, 100, 150)
|
||||
tree_lines: tuple[int, int, int] = (60, 60, 60)
|
||||
unsaved_marker: tuple[int, int, int] = (200, 200, 200)
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, data: dict[str, Any]) -> ThemePalette:
|
||||
@@ -122,7 +152,7 @@ def load_theme_file(path: Path, scope: str) -> ThemeFile:
|
||||
raise ValueError(f"failed to parse theme TOML {path}: {e}") from e
|
||||
if not isinstance(data, dict):
|
||||
raise ValueError(f"theme TOML {path} must be a top-level table")
|
||||
name = path.stem
|
||||
name = data.get("name", path.stem)
|
||||
theme = ThemeFile.from_dict(name, data, source_path=path, scope=scope)
|
||||
return theme
|
||||
|
||||
|
||||
Reference in New Issue
Block a user