pub mod tokens {
pub const SUCCESS: &str = "#0f766e";
pub const SUCCESS_BRIGHT: &str = "#22c55e";
pub const WARN: &str = "#f59e0b";
pub const WARN_DEEP: &str = "#d97706";
pub const DANGER: &str = "#dc2626";
pub const DANGER_LIGHT: &str = "#ef4444";
pub const NEUTRAL: &str = "#475569";
pub const INFO: &str = "#2563eb";
pub const ACCENT_BRONZE: &str = "#b45309";
}
pub fn score_color(score: u32) -> &'static str {
if score >= 70 {
tokens::SUCCESS_BRIGHT
} else if score >= 50 {
tokens::WARN
} else {
tokens::DANGER_LIGHT
}
}
pub fn module_score_color(score: u32) -> &'static str {
if score >= 85 {
tokens::SUCCESS
} else if score >= 70 {
tokens::INFO
} else if score >= 50 {
tokens::WARN_DEEP
} else {
tokens::DANGER
}
}
pub fn risk_status(label: &str) -> &'static str {
match label {
"Kritisch" | "Critical" => "bad",
"Hoch" | "High" => "warn",
"Mittel" | "Medium" => "info",
_ => "good",
}
}