More colors for shallow scripts and more steps

This commit is contained in:
2026-01-23 00:36:04 +01:00
parent 88b6f64a72
commit 1aad52eed1
5 changed files with 33 additions and 23 deletions

View File

@@ -41,12 +41,7 @@ fn render_sequencer(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot,
let pattern = app.current_edit_pattern();
let length = pattern.length;
let num_rows = match length {
0..=8 => 1,
9..=16 => 2,
17..=24 => 3,
_ => 4,
};
let num_rows = length.div_ceil(8);
let steps_per_row = length.div_ceil(num_rows);
let spacing = num_rows.saturating_sub(1) as u16;
@@ -110,12 +105,37 @@ fn render_tile(
false
};
let link_color = step.and_then(|s| s.source).map(|src| {
const BRIGHT: [(u8, u8, u8); 5] = [
(180, 140, 220),
(220, 140, 170),
(220, 180, 130),
(130, 180, 220),
(170, 220, 140),
];
const DIM: [(u8, u8, u8); 5] = [
(90, 70, 120),
(120, 70, 85),
(120, 90, 65),
(65, 90, 120),
(85, 120, 70),
];
let i = src % 5;
(BRIGHT[i], DIM[i])
});
let (bg, fg) = match (is_playing, is_active, is_selected, is_linked) {
(true, true, _, _) => (Color::Rgb(195, 85, 65), Color::White),
(true, false, _, _) => (Color::Rgb(180, 120, 45), Color::Black),
(false, true, true, true) => (Color::Rgb(180, 140, 220), Color::Black),
(false, true, true, true) => {
let (r, g, b) = link_color.unwrap().0;
(Color::Rgb(r, g, b), Color::Black)
}
(false, true, true, false) => (Color::Rgb(0, 220, 180), Color::Black),
(false, true, false, true) => (Color::Rgb(90, 70, 120), Color::White),
(false, true, false, true) => {
let (r, g, b) = link_color.unwrap().1;
(Color::Rgb(r, g, b), Color::White)
}
(false, true, false, false) => (Color::Rgb(45, 106, 95), Color::White),
(false, false, true, _) => (Color::Rgb(80, 180, 255), Color::Black),
(false, false, false, _) => (Color::Rgb(45, 48, 55), Color::Rgb(120, 125, 135)),

View File

@@ -319,7 +319,7 @@ fn render_modal(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, term
}
Modal::SetPattern { field, input } => {
let (title, hint) = match field {
PatternField::Length => ("Set Length (2-32)", "Enter number"),
PatternField::Length => ("Set Length (1-128)", "Enter number"),
PatternField::Speed => ("Set Speed", "1/8x, 1/4x, 1/2x, 1x, 2x, 4x, 8x"),
};
TextInputModal::new(title, input)