remove old color defs; move PPQ and CORNERS to core

This commit is contained in:
🪞👃🪞 2024-11-02 21:03:42 +02:00
parent 1ab1b695a4
commit 0f3103a003
4 changed files with 11 additions and 24 deletions

View file

@ -2,6 +2,8 @@ use crate::*;
use std::iter::Iterator;
pub const DEFAULT_PPQ: f64 = 96.0;
/// FIXME: remove this and use PPQ from timebase everywhere:
pub const PPQ: usize = 96;
/// A unit of time, represented as an atomic 64-bit float.
///

View file

@ -676,14 +676,10 @@ border! {
}
}
pub const COLOR_BG0: Color = Color::Rgb(30, 33, 36);
pub const COLOR_BG1: Color = Color::Rgb(41, 46, 57);
pub const COLOR_BG2: Color = Color::Rgb(46, 52, 64);
pub const COLOR_BG3: Color = Color::Rgb(59, 66, 82);
pub const COLOR_BG4: Color = Color::Rgb(67, 76, 94);
pub const COLOR_BG5: Color = Color::Rgb(76, 86, 106);
pub const COLOR_RED: Color = Color::Rgb(191, 97, 106);
pub const COLOR_YELLOW: Color = Color::Rgb(235, 203, 139);
pub const COLOR_GREEN: Color = Color::Rgb(163, 190, 140);
pub const COLOR_PLAYING: Color = Color::Rgb(60, 100, 50);
pub const COLOR_SEPARATOR: Color = Color::Rgb(0, 0, 0);
pub const CORNERS: CornersTall = CornersTall(Style {
fg: Some(Color::Rgb(96, 255, 32)),
bg: None,
underline_color: None,
add_modifier: Modifier::empty(),
sub_modifier: Modifier::DIM
});

View file

@ -149,7 +149,7 @@ impl<'a> Content for VerticalArranger<'a, Tui> {
let any_size = |_|Ok(Some([0,0]));
// column separators
add(&CustomWidget::new(any_size, move|to: &mut TuiOutput|{
let style = Some(Style::default().fg(COLOR_SEPARATOR));
let style = Some(Style::default().fg(Color::Rgb(0, 0, 0)));
Ok(for x in cols.iter().map(|col|col.1) {
let x = scene_title_w + to.area().x() + x as u16;
for y in to.area().y()..to.area().y2() { to.blit(&"", x, y, style); }
@ -164,7 +164,7 @@ impl<'a> Content for VerticalArranger<'a, Tui> {
if x < to.buffer.area.x && y < to.buffer.area.y {
let cell = to.buffer.get_mut(x, y);
cell.modifier = Modifier::UNDERLINED;
cell.underline_color = COLOR_SEPARATOR;
cell.underline_color = Color::Rgb(0, 0, 0);
}
}
})

View file

@ -12,17 +12,6 @@ submod! {
transport transport_cmd transport_tui transport_snd
}
/// FIXME: use PPQ value from global timebase
pub const PPQ: usize = 96;
pub const CORNERS: CornersTall = CornersTall(Style {
fg: Some(Color::Rgb(96, 255, 32)),
bg: None,
underline_color: None,
add_modifier: Modifier::empty(),
sub_modifier: Modifier::DIM
});
/// Octave number (from -1 to 9)
pub const NTH_OCTAVE: [&'static str;11] = [
"-1", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"