pub mod tokens {
pub const SUCCESS: &str = "#0f766e";
pub const INFO: &str = "#2563eb";
pub const WARN_DEEP: &str = "#d97706";
pub const DANGER: &str = "#dc2626";
pub const INK: &str = "#0f172a";
pub const NEUTRAL: &str = "#475569";
pub const MUTED: &str = "#94a3b8";
#[allow(dead_code)]
pub const BORDER: &str = "#e2e8f0";
#[allow(dead_code)]
pub const SURFACE: &str = "#f8fafc";
}
pub fn score_color(score: u8) -> &'static str {
match score {
75..=100 => tokens::SUCCESS,
40..=74 => tokens::WARN_DEEP,
_ => tokens::DANGER,
}
}
#[allow(dead_code)]
pub fn status_color(status: &str) -> &'static str {
match status {
"good" => tokens::SUCCESS,
"warn" => tokens::WARN_DEEP,
"bad" => tokens::DANGER,
_ => tokens::INFO,
}
}
#[allow(dead_code)]
pub fn severity_color(severity: crate::wcag::Severity) -> &'static str {
use crate::wcag::Severity::*;
match severity {
Critical | High => tokens::DANGER,
Medium => tokens::WARN_DEEP,
_ => tokens::INFO,
}
}