Skip to content

Commit

Permalink
Tweak alert colors
Browse files Browse the repository at this point in the history
So that they work with both dark and light mode
  • Loading branch information
lampsitter committed Feb 19, 2024
1 parent 0497fbb commit 0abd301
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/alerts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ use std::collections::HashMap;
pub struct Alert {
/// The color that will be used to put emphasis to the alert
pub accent_color: egui::Color32,
/// The icon that will be rendered
/// The icon that will be displayed
pub icon: char,
/// The identifier that will be look for in the blockquote
/// The identifier that will be used to look for the blockquote such as NOTE and TIP
pub identifier: String,
/// The identifier that will be shown when rendering
/// The identifier that will be shown when rendering. E.g: Note and Tip
pub identifier_rendered: String,
}

Expand Down Expand Up @@ -62,31 +62,31 @@ impl AlertBundle {
pub fn gfm() -> Self {
Self::from_alerts(vec![
Alert {
accent_color: egui::Color32::BLUE,
accent_color: egui::Color32::from_rgb(10, 80, 210),
icon: '❕',
identifier: "NOTE".to_owned(),
identifier_rendered: "Note".to_owned(),
},
Alert {
accent_color: egui::Color32::LIGHT_GREEN,
accent_color: egui::Color32::from_rgb(0, 130, 20),
icon: '💡',
identifier: "TIP".to_owned(),
identifier_rendered: "Tip".to_owned(),
},
Alert {
accent_color: egui::Color32::DARK_GREEN, // FIXME: Purple
accent_color: egui::Color32::from_rgb(150, 30, 140),
icon: '💬',
identifier: "IMPORTANT".to_owned(),
identifier_rendered: "Important".to_owned(),
},
Alert {
accent_color: egui::Color32::YELLOW,
accent_color: egui::Color32::from_rgb(200, 120, 0),
icon: '⚠',
identifier: "WARNING".to_owned(),
identifier_rendered: "Warning".to_owned(),
},
Alert {
accent_color: egui::Color32::RED,
accent_color: egui::Color32::from_rgb(220, 0, 0),
icon: '🔴',
identifier: "CAUTION".to_owned(),
identifier_rendered: "Caution".to_owned(),
Expand Down

0 comments on commit 0abd301

Please sign in to comment.