added structure for notice and color getter
This commit is contained in:
parent
35c7c6a02c
commit
4e82d59ef4
1 changed files with 29 additions and 0 deletions
29
src/models.rs
Normal file
29
src/models.rs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
pub struct Notice {
|
||||
pub affected_lines: Vec<String>,
|
||||
pub dest_1: String,
|
||||
pub dest_2: String,
|
||||
pub headline: String,
|
||||
pub detail: String,
|
||||
pub from: u32,
|
||||
pub to: u32,
|
||||
pub last_modified: String,
|
||||
}
|
||||
|
||||
pub fn get_line_color(line_number: &str) -> (u8, u8, u8) {
|
||||
match line_number {
|
||||
// Rot: Linien 1, 2, 8
|
||||
"1" | "2" | "8" => (238, 66, 36),
|
||||
|
||||
// Gelb (Die besten Linien): Linien 4, 5, 6, 11
|
||||
"4" | "5" | "6" | "11" => (248, 166, 28),
|
||||
|
||||
// Grün: Linien 9, 10, 12, 17
|
||||
"10" | "12" | "17" => (110, 191, 69),
|
||||
|
||||
// Blau: Linien 3, 7, 9, 13
|
||||
"3" | "7" | "9" | "13" => (0, 114, 188),
|
||||
|
||||
// Fallback (z.B. für das Standard-Blau aus deiner API)
|
||||
_ => (55, 101, 174),
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue