clankerdiff-theme 0.1.0

Renderer-neutral themes and palettes for Diff
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use clankerdiff_theme::{FontStyle, Rgba, SyntaxStyle, SyntaxTheme};

#[test]
fn builder_provides_capture_fallback_and_revision() {
    let theme = SyntaxTheme::builder("test")
        .capture(
            "keyword",
            SyntaxStyle {
                foreground: Rgba::new(1, 2, 3, 255),
                font_style: FontStyle::default(),
            },
        )
        .build()
        .unwrap();
    assert_eq!(theme.style("keyword.control"), theme.style("keyword"));
    assert_ne!(theme.revision(), SyntaxTheme::default().revision());
}