scene and track colors; random_color_near

This commit is contained in:
🪞👃🪞 2024-10-11 18:02:03 +03:00
parent f500c717a2
commit 6bee5b0bcd
5 changed files with 80 additions and 38 deletions

View file

@ -120,7 +120,8 @@ impl Handle<Tui> for PhrasePool<Tui> {
self.phrase += 1;
},
key!(KeyCode::Char('d')) => { // insert duplicate
let phrase = (*self.phrases[self.phrase].read().unwrap()).clone();
let mut phrase = (*self.phrases[self.phrase].read().unwrap()).clone();
phrase.color = random_color_near(phrase.color, 0.1);
self.phrases.insert(self.phrase + 1, Arc::new(RwLock::new(phrase)));
self.phrase += 1;
},