eulumdat/
diagram.rs

1//! Diagram-related types for Python bindings
2
3use pyo3::prelude::*;
4
5use ::eulumdat as core;
6use core::diagram::SvgTheme as CoreSvgTheme;
7
8/// SVG theme for diagram rendering.
9#[pyclass(eq, eq_int)]
10#[derive(Clone, Copy, PartialEq, Eq)]
11pub enum SvgTheme {
12    /// Light theme with white background
13    Light = 0,
14    /// Dark theme with dark background
15    Dark = 1,
16    /// CSS variables for dynamic theming
17    CssVariables = 2,
18}
19
20#[pymethods]
21impl SvgTheme {
22    fn __repr__(&self) -> String {
23        match self {
24            Self::Light => "SvgTheme.Light".to_string(),
25            Self::Dark => "SvgTheme.Dark".to_string(),
26            Self::CssVariables => "SvgTheme.CssVariables".to_string(),
27        }
28    }
29}
30
31impl SvgTheme {
32    pub(crate) fn to_core(self) -> CoreSvgTheme {
33        match self {
34            Self::Light => CoreSvgTheme::light(),
35            Self::Dark => CoreSvgTheme::dark(),
36            Self::CssVariables => CoreSvgTheme::css_variables(),
37        }
38    }
39}