| 1 | use gpui::{App, Hsla}; |
| 2 | use gpui_base::input::DiagnosticSeverity; |
| 3 | |
| 4 | use crate::ActiveTheme as _; |
| 5 | |
| 6 | pub(crate) fn diagnostic_background(severity: DiagnosticSeverity, cx: &App) -> Hsla { |
| 7 | let status = &cx.theme().highlight_theme.style.status; |
| 8 | match severity { |
| 9 | DiagnosticSeverity::Error => status.error_background(cx), |
| 10 | DiagnosticSeverity::Warning => status.warning_background(cx), |
| 11 | DiagnosticSeverity::Info => status.info_background(cx), |
| 12 | DiagnosticSeverity::Hint => status.hint_background(cx), |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | pub(crate) fn diagnostic_foreground(severity: DiagnosticSeverity, cx: &App) -> Hsla { |
| 17 | let status = &cx.theme().highlight_theme.style.status; |
| 18 | match severity { |
| 19 | DiagnosticSeverity::Error => status.error(cx), |
| 20 | DiagnosticSeverity::Warning => status.warning(cx), |
| 21 | DiagnosticSeverity::Info => status.info(cx), |
| 22 | DiagnosticSeverity::Hint => status.hint(cx), |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | pub(crate) fn diagnostic_border(severity: DiagnosticSeverity, cx: &App) -> Hsla { |
| 27 | let status = &cx.theme().highlight_theme.style.status; |
| 28 | match severity { |
| 29 | DiagnosticSeverity::Error => status.error_border(cx), |
| 30 | DiagnosticSeverity::Warning => status.warning_border(cx), |
| 31 | DiagnosticSeverity::Info => status.info_border(cx), |
| 32 | DiagnosticSeverity::Hint => status.hint_border(cx), |
| 33 | } |
| 34 | } |