mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-13 07:06:41 +01:00
pre generate grayscale palettes
This commit is contained in:
parent
cfa3cad5cb
commit
ee28d431bd
7 changed files with 16 additions and 12 deletions
|
|
@ -28,9 +28,7 @@ impl PianoHorizontal {
|
|||
buffer: RwLock::new(Default::default()).into(),
|
||||
point: MidiPointModel::default(),
|
||||
clip: clip.cloned(),
|
||||
color: clip.as_ref()
|
||||
.map(|p|p.read().unwrap().color)
|
||||
.unwrap_or(ItemPalette::from(ItemColor::from(Tui::g(64)))),
|
||||
color: clip.as_ref().map(|p|p.read().unwrap().color).unwrap_or(ItemPalette::G[64]),
|
||||
};
|
||||
piano.redraw();
|
||||
piano
|
||||
|
|
@ -270,7 +268,7 @@ impl MidiViewer for PianoHorizontal {
|
|||
fn set_clip (&mut self, clip: Option<&Arc<RwLock<MidiClip>>>) {
|
||||
*self.clip_mut() = clip.cloned();
|
||||
self.color = clip.map(|p|p.read().unwrap().color)
|
||||
.unwrap_or(ItemPalette::from(ItemColor::from(Tui::g(64))));
|
||||
.unwrap_or(ItemPalette::G[64]);
|
||||
self.redraw();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue