Skip to content

Commit

Permalink
change the trigger text color when learning
Browse files Browse the repository at this point in the history
  • Loading branch information
magnetophon committed Nov 15, 2024
1 parent 7813a19 commit 3085369
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,10 @@ impl ActionTrigger {
Self::get_note_name(note_nr)
}),
)
.color(learned_notes.map(move |notes| {
let note_nr = notes.load(own_index);
Self::get_note_color(note_nr)
}))
.class("action-label");
})
}
Expand Down Expand Up @@ -859,6 +863,15 @@ impl ActionTrigger {
}
}

fn get_note_color(note_nr: u8) -> Color {
if note_nr == LEARNING {
// blue
Color::rgb(88, 121, 175)
// Color::rgb(13, 25, 49) // dark grey
} else {
Color::rgb(224, 206, 145) // yellow
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// for drawing
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 3085369

Please sign in to comment.