randomize arrangement bg color

This commit is contained in:
🪞👃🪞 2024-10-18 20:05:38 +03:00
parent cd2a94d808
commit cc578b0b52
3 changed files with 20 additions and 5 deletions

View file

@ -33,7 +33,9 @@ pub struct Arrangement<E: Engine> {
/// Display mode of arranger
pub mode: ArrangementViewMode,
/// Whether the arranger is currently focused
pub focused: bool
pub focused: bool,
/// Background color of arrangement
pub color: Color,
}
/// Represents a track in the arrangement
pub struct ArrangementTrack<E: Engine> {
@ -149,7 +151,8 @@ impl<E: Engine> Arrangement<E> {
phrases: phrases.clone(),
scenes: vec![],
tracks: vec![],
focused: false
focused: false,
color: Color::Rgb(28, 35, 25),
}
}
pub fn activate (&mut self) {
@ -277,7 +280,7 @@ impl<E: Engine> Arrangement<E> {
}
pub fn randomize_color (&mut self) {
match self.selected {
ArrangementFocus::Mix => {},
ArrangementFocus::Mix => { self.color = random_color_dark() },
ArrangementFocus::Track(t) => { self.tracks[t].color = random_color() },
ArrangementFocus::Scene(s) => { self.scenes[s].color = random_color() },
ArrangementFocus::Clip(t, s) => if let Some(phrase) = &self.scenes[s].clips[t] {