pub struct ColorScheme {Show 37 fields
pub added: Color,
pub removed: Color,
pub modified: Color,
pub unchanged: Color,
pub critical: Color,
pub high: Color,
pub medium: Color,
pub low: Color,
pub info: Color,
pub permissive: Color,
pub copyleft: Color,
pub weak_copyleft: Color,
pub proprietary: Color,
pub unknown_license: Color,
pub primary: Color,
pub secondary: Color,
pub accent: Color,
pub muted: Color,
pub border: Color,
pub border_focused: Color,
pub background: Color,
pub background_alt: Color,
pub text: Color,
pub text_muted: Color,
pub selection: Color,
pub highlight: Color,
pub success: Color,
pub warning: Color,
pub error: Color,
pub badge_fg_dark: Color,
pub badge_fg_light: Color,
pub selection_bg: Color,
pub search_highlight_bg: Color,
pub error_bg: Color,
pub success_bg: Color,
pub scope_bg: Color,
pub monochrome: bool,
}Expand description
Color scheme for the TUI application. Provides semantic colors for different UI elements.
Fields§
§added: Color§removed: Color§modified: Color§unchanged: Color§critical: Color§high: Color§medium: Color§low: Color§info: Color§permissive: Color§copyleft: Color§weak_copyleft: Color§proprietary: Color§unknown_license: Color§primary: Color§secondary: Color§accent: Color§muted: Color§border: Color§border_focused: Color§background: Color§background_alt: Color§text: Color§text_muted: Color§selection: Color§highlight: Color§success: Color§warning: Color§error: Color§badge_fg_dark: Color§badge_fg_light: Color§selection_bg: Color§search_highlight_bg: Color§error_bg: Color§success_bg: Color§scope_bg: Color§monochrome: boolTrue for the NO_COLOR / monochrome scheme: hue-dependent helpers
(severity tints, KEV/dependency badges) must return Color::Reset.
Implementations§
Source§impl ColorScheme
impl ColorScheme
Sourcepub const fn high_contrast() -> Self
pub const fn high_contrast() -> Self
High contrast theme (accessibility)
Sourcepub const fn monochrome() -> Self
pub const fn monochrome() -> Self
Monochrome theme honoring the NO_COLOR convention: grayscale only —
no named hue, no RGB. Structure is carried by weight (bold), glyphs, and
gray levels instead of color.
Sourcepub fn severity_color(&self, severity: &str) -> Color
pub fn severity_color(&self, severity: &str) -> Color
Get color for severity level
Sourcepub fn severity_bg_tint(&self, severity: &str) -> Color
pub fn severity_bg_tint(&self, severity: &str) -> Color
Get a subtle background tint for severity (used for row highlighting) Subtle row-background tint for a severity, adapted to the active theme.
Dark themes use dark tints; light themes use pale tints so the dark row text stays readable (the previous hardcoded dark tints made light-theme rows unreadable — dark-on-dark).
Sourcepub fn change_color(&self, status: &str) -> Color
pub fn change_color(&self, status: &str) -> Color
Get color for change status
Sourcepub fn severity_badge_fg(&self, severity: &str) -> Color
pub fn severity_badge_fg(&self, severity: &str) -> Color
Get appropriate foreground color for severity badges Returns light fg for dark backgrounds (critical, high, info) and dark fg for bright backgrounds
Sourcepub fn kev(&self) -> Color
pub fn kev(&self) -> Color
Get KEV (Known Exploited Vulnerabilities) badge color Returns a bright red/orange color to indicate active exploitation
Sourcepub const fn kev_badge_fg(&self) -> Color
pub const fn kev_badge_fg(&self) -> Color
Get KEV badge foreground color
Sourcepub fn direct_dep(&self) -> Color
pub fn direct_dep(&self) -> Color
Get direct dependency badge background color (green - easy to fix)
Sourcepub fn transitive_dep(&self) -> Color
pub fn transitive_dep(&self) -> Color
Get transitive dependency badge background color (gray - harder to fix)
Sourcepub const fn change_badge_fg(&self) -> Color
pub const fn change_badge_fg(&self) -> Color
Get appropriate foreground color for change status badges All change colors (green, red, yellow) work best with dark foreground
Sourcepub fn badge_fg_for(&self, bg: Color) -> Color
pub fn badge_fg_for(&self, bg: Color) -> Color
Pick a readable badge foreground for an arbitrary badge background: bright ANSI colors and high-luminance RGB get the dark foreground, everything else the light one.
Sourcepub fn license_badge_fg(&self, category: &str) -> Color
pub fn license_badge_fg(&self, category: &str) -> Color
Get appropriate foreground color for license category badges
Sourcepub const fn chart_palette(&self) -> [Color; 5]
pub const fn chart_palette(&self) -> [Color; 5]
Chart color palette for visualizations
Trait Implementations§
Source§impl Clone for ColorScheme
impl Clone for ColorScheme
Source§fn clone(&self) -> ColorScheme
fn clone(&self) -> ColorScheme
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ColorScheme
Source§impl Debug for ColorScheme
impl Debug for ColorScheme
Auto Trait Implementations§
impl Freeze for ColorScheme
impl RefUnwindSafe for ColorScheme
impl Send for ColorScheme
impl Sync for ColorScheme
impl Unpin for ColorScheme
impl UnsafeUnpin for ColorScheme
impl UnwindSafe for ColorScheme
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more