feat: render screenshots using session theme palettes
Pass per-theme background, foreground, and 16-color palettes into the SVG exporter so screenshots match the active session theme (including ANSI colors). Adds theme palette mappings and updates screenshot tests to validate themed backgrounds and palette-aware color conversion.
This commit is contained in:
@@ -55,6 +55,30 @@ class TestColorToHex:
|
||||
"""Color conversion covers named/hex/default cases."""
|
||||
assert _color_to_hex(color, is_foreground=is_foreground) == expected
|
||||
|
||||
def test_color_to_hex_uses_palette_defaults(self) -> None:
|
||||
palette = {"red": "#123456"}
|
||||
assert _color_to_hex(
|
||||
"default",
|
||||
is_foreground=True,
|
||||
palette=palette,
|
||||
default_fg="#111111",
|
||||
default_bg="#222222",
|
||||
) == "#111111"
|
||||
assert _color_to_hex(
|
||||
"default",
|
||||
is_foreground=False,
|
||||
palette=palette,
|
||||
default_fg="#111111",
|
||||
default_bg="#222222",
|
||||
) == "#222222"
|
||||
assert _color_to_hex(
|
||||
"red",
|
||||
is_foreground=True,
|
||||
palette=palette,
|
||||
default_fg="#111111",
|
||||
default_bg="#222222",
|
||||
) == "#123456"
|
||||
|
||||
|
||||
class TestEscapeXml:
|
||||
"""Tests for XML escaping."""
|
||||
|
||||
Reference in New Issue
Block a user