• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

facet-rs / facet / 20102126400

10 Dec 2025 02:31PM UTC coverage: 58.173% (-0.4%) from 58.588%
20102126400

Pull #1220

github

web-flow
Merge 92de7333f into eaae4b56d
Pull Request #1220: feat(cinereus): improve tree matching for leaf nodes and filter no-op moves

1583 of 2962 new or added lines in 18 files covered. (53.44%)

111 existing lines in 3 files now uncovered.

28390 of 48803 relevant lines covered (58.17%)

819.3 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

27.27
/facet-diff-core/src/theme.rs
1
//! Color themes for diff rendering.
2

3
use owo_colors::Rgb;
4

5
/// Color theme for diff rendering.
6
///
7
/// Defines colors for different kinds of changes. The default uses
8
/// One Dark Pro colors.
9
#[derive(Debug, Clone, PartialEq, Eq)]
10
pub struct DiffTheme {
11
    /// Color for deleted content (default: red)
12
    pub deleted: Rgb,
13

14
    /// Color for inserted content (default: green)
15
    pub inserted: Rgb,
16

17
    /// Color for moved content (default: blue)
18
    pub moved: Rgb,
19

20
    /// Color for unchanged content (default: white)
21
    pub unchanged: Rgb,
22

23
    /// Color for keys/field names (default: white)
24
    pub key: Rgb,
25

26
    /// Color for structural elements like braces, brackets (default: white)
27
    pub structure: Rgb,
28

29
    /// Color for comments and type hints (default: gray/muted)
30
    pub comment: Rgb,
31
}
32

33
impl Default for DiffTheme {
34
    fn default() -> Self {
2✔
35
        Self::ONE_DARK_PRO
2✔
36
    }
2✔
37
}
38

39
impl DiffTheme {
40
    /// One Dark Pro color theme (default).
41
    pub const ONE_DARK_PRO: Self = Self {
42
        deleted: Rgb(224, 108, 117),   // #e06c75 red
43
        inserted: Rgb(152, 195, 121),  // #98c379 green
44
        moved: Rgb(97, 175, 239),      // #61afef blue
45
        unchanged: Rgb(171, 178, 191), // #abb2bf white (normal text)
46
        key: Rgb(171, 178, 191),       // #abb2bf white
47
        structure: Rgb(171, 178, 191), // #abb2bf white
48
        comment: Rgb(92, 99, 112),     // #5c6370 gray (muted)
49
    };
50

51
    /// Tokyo Night color theme.
52
    pub const TOKYO_NIGHT: Self = Self {
53
        deleted: Rgb(247, 118, 142),   // red
54
        inserted: Rgb(158, 206, 106),  // green
55
        moved: Rgb(122, 162, 247),     // blue
56
        unchanged: Rgb(192, 202, 245), // white (normal text)
57
        key: Rgb(192, 202, 245),       // white
58
        structure: Rgb(192, 202, 245), // white
59
        comment: Rgb(86, 95, 137),     // gray (muted)
60
    };
61

62
    /// Get the color for a change kind.
NEW
63
    pub fn color_for(&self, kind: crate::ChangeKind) -> Rgb {
×
NEW
64
        match kind {
×
NEW
65
            crate::ChangeKind::Unchanged => self.unchanged,
×
NEW
66
            crate::ChangeKind::Deleted => self.deleted,
×
NEW
67
            crate::ChangeKind::Inserted => self.inserted,
×
NEW
68
            crate::ChangeKind::MovedFrom | crate::ChangeKind::MovedTo => self.moved,
×
NEW
69
            crate::ChangeKind::Modified => self.deleted, // old value gets deleted color
×
70
        }
NEW
71
    }
×
72
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc