(
json: &OpencodeThemeJson,
defs: &HashMap<String, ColorValueJson>,
v: &ColorValueJson,
mode: &str,
seen: &mut HashSet<String>,
)
| 907 | } |
| 908 | |
| 909 | fn resolve_color_value( |
| 910 | json: &OpencodeThemeJson, |
| 911 | defs: &HashMap<String, ColorValueJson>, |
| 912 | v: &ColorValueJson, |
| 913 | mode: &str, |
| 914 | seen: &mut HashSet<String>, |
| 915 | ) -> anyhow::Result<Color> { |
| 916 | match v { |
| 917 | ColorValueJson::Number(n) => Ok(Color::Indexed(*n)), |
| 918 | ColorValueJson::Variant { dark, light } => { |
| 919 | if mode == "light" { |
| 920 | resolve_color_value(json, defs, light, mode, seen) |
| 921 | } else { |
| 922 | resolve_color_value(json, defs, dark, mode, seen) |
| 923 | } |
| 924 | } |
| 925 | ColorValueJson::String(s) => resolve_color_string(json, defs, s, mode, seen), |
| 926 | } |
| 927 | } |
| 928 | |
| 929 | fn resolve_color_string( |
| 930 | json: &OpencodeThemeJson, |
no test coverage detected