Feat: begin slight refactoring

This commit is contained in:
2026-02-01 12:38:48 +01:00
parent 5b4a6ddd14
commit c356aebfde
39 changed files with 4699 additions and 3168 deletions

View File

@@ -0,0 +1,277 @@
use super::*;
use ratatui::style::Color;
pub fn theme() -> ThemeColors {
let bg = Color::Rgb(0, 0, 0);
let surface = Color::Rgb(10, 10, 10);
let surface2 = Color::Rgb(21, 21, 21);
let border = Color::Rgb(40, 40, 40);
let fg = Color::Rgb(230, 230, 230);
let fg_dim = Color::Rgb(160, 160, 160);
let fg_muted = Color::Rgb(100, 100, 100);
let red = Color::Rgb(255, 80, 80);
let green = Color::Rgb(80, 255, 120);
let yellow = Color::Rgb(255, 230, 80);
let blue = Color::Rgb(80, 180, 255);
let purple = Color::Rgb(200, 120, 255);
let cyan = Color::Rgb(80, 230, 230);
let orange = Color::Rgb(255, 160, 60);
ThemeColors {
ui: UiColors {
bg,
bg_rgb: (0, 0, 0),
text_primary: fg,
text_muted: fg_dim,
text_dim: fg_muted,
border,
header: blue,
unfocused: fg_muted,
accent: cyan,
surface,
},
status: StatusColors {
playing_bg: Color::Rgb(15, 35, 20),
playing_fg: green,
stopped_bg: Color::Rgb(40, 15, 20),
stopped_fg: red,
fill_on: green,
fill_off: fg_muted,
fill_bg: surface,
},
selection: SelectionColors {
cursor_bg: cyan,
cursor_fg: bg,
selected_bg: Color::Rgb(40, 50, 60),
selected_fg: cyan,
in_range_bg: Color::Rgb(25, 35, 45),
in_range_fg: fg,
cursor: cyan,
selected: Color::Rgb(40, 50, 60),
in_range: Color::Rgb(25, 35, 45),
},
tile: TileColors {
playing_active_bg: Color::Rgb(50, 35, 20),
playing_active_fg: orange,
playing_inactive_bg: Color::Rgb(45, 40, 15),
playing_inactive_fg: yellow,
active_bg: Color::Rgb(15, 40, 40),
active_fg: cyan,
inactive_bg: surface,
inactive_fg: fg_dim,
active_selected_bg: Color::Rgb(45, 40, 55),
active_in_range_bg: Color::Rgb(30, 35, 45),
link_bright: [
(80, 230, 230),
(200, 120, 255),
(255, 160, 60),
(80, 180, 255),
(80, 255, 120),
],
link_dim: [
(25, 60, 60),
(50, 35, 65),
(60, 45, 20),
(25, 50, 70),
(25, 65, 35),
],
},
header: HeaderColors {
tempo_bg: Color::Rgb(50, 35, 55),
tempo_fg: purple,
bank_bg: Color::Rgb(20, 45, 60),
bank_fg: blue,
pattern_bg: Color::Rgb(20, 55, 50),
pattern_fg: cyan,
stats_bg: surface,
stats_fg: fg_dim,
},
modal: ModalColors {
border: cyan,
border_accent: purple,
border_warn: orange,
border_dim: fg_muted,
confirm: orange,
rename: purple,
input: blue,
editor: cyan,
preview: fg_muted,
},
flash: FlashColors {
error_bg: Color::Rgb(50, 15, 20),
error_fg: red,
success_bg: Color::Rgb(15, 45, 25),
success_fg: green,
info_bg: surface,
info_fg: fg,
event_rgb: (40, 30, 50),
},
list: ListColors {
playing_bg: Color::Rgb(15, 45, 25),
playing_fg: green,
staged_play_bg: Color::Rgb(45, 30, 55),
staged_play_fg: purple,
staged_stop_bg: Color::Rgb(55, 25, 30),
staged_stop_fg: red,
edit_bg: Color::Rgb(15, 45, 45),
edit_fg: cyan,
hover_bg: surface2,
hover_fg: fg,
},
link_status: LinkStatusColors {
disabled: red,
connected: green,
listening: yellow,
},
syntax: SyntaxColors {
gap_bg: bg,
executed_bg: Color::Rgb(25, 25, 35),
selected_bg: Color::Rgb(55, 45, 25),
emit: (fg, Color::Rgb(50, 30, 35)),
number: (orange, Color::Rgb(50, 35, 20)),
string: (green, Color::Rgb(20, 45, 25)),
comment: (fg_muted, bg),
keyword: (purple, Color::Rgb(40, 25, 50)),
stack_op: (blue, Color::Rgb(20, 40, 55)),
operator: (yellow, Color::Rgb(50, 45, 20)),
sound: (cyan, Color::Rgb(20, 45, 45)),
param: (purple, Color::Rgb(40, 25, 50)),
context: (orange, Color::Rgb(50, 35, 20)),
note: (green, Color::Rgb(20, 45, 25)),
interval: (Color::Rgb(130, 255, 150), Color::Rgb(25, 55, 35)),
variable: (purple, Color::Rgb(40, 25, 50)),
vary: (yellow, Color::Rgb(50, 45, 20)),
generator: (cyan, Color::Rgb(20, 45, 40)),
default: (fg_dim, bg),
},
table: TableColors {
row_even: bg,
row_odd: surface,
},
values: ValuesColors {
tempo: orange,
value: fg_dim,
},
hint: HintColors {
key: orange,
text: fg_muted,
},
view_badge: ViewBadgeColors { bg: fg, fg: bg },
nav: NavColors {
selected_bg: Color::Rgb(40, 45, 55),
selected_fg: fg,
unselected_bg: surface,
unselected_fg: fg_muted,
},
editor_widget: EditorWidgetColors {
cursor_bg: fg,
cursor_fg: bg,
selection_bg: Color::Rgb(40, 50, 65),
completion_bg: surface,
completion_fg: fg,
completion_selected: orange,
completion_example: cyan,
},
browser: BrowserColors {
directory: blue,
project_file: purple,
selected: orange,
file: fg,
focused_border: orange,
unfocused_border: fg_muted,
root: fg,
file_icon: fg_muted,
folder_icon: blue,
empty_text: fg_muted,
},
input: InputColors {
text: blue,
cursor: fg,
hint: fg_muted,
},
search: SearchColors {
active: orange,
inactive: fg_muted,
match_bg: yellow,
match_fg: bg,
},
markdown: MarkdownColors {
h1: blue,
h2: orange,
h3: purple,
code: green,
code_border: Color::Rgb(50, 50, 50),
link: cyan,
link_url: Color::Rgb(90, 90, 90),
quote: fg_muted,
text: fg,
list: fg,
},
engine: EngineColors {
header: blue,
header_focused: yellow,
divider: Color::Rgb(45, 45, 45),
scroll_indicator: Color::Rgb(60, 60, 60),
label: Color::Rgb(130, 130, 130),
label_focused: Color::Rgb(170, 170, 170),
label_dim: Color::Rgb(90, 90, 90),
value: Color::Rgb(200, 200, 200),
focused: yellow,
normal: fg,
dim: Color::Rgb(60, 60, 60),
path: Color::Rgb(130, 130, 130),
border_magenta: purple,
border_green: green,
border_cyan: cyan,
separator: Color::Rgb(45, 45, 45),
hint_active: Color::Rgb(220, 200, 80),
hint_inactive: Color::Rgb(45, 45, 45),
},
dict: DictColors {
word_name: green,
word_bg: Color::Rgb(20, 30, 35),
alias: fg_muted,
stack_sig: purple,
description: fg,
example: Color::Rgb(130, 130, 130),
category_focused: yellow,
category_selected: blue,
category_normal: fg,
category_dimmed: Color::Rgb(60, 60, 60),
border_focused: yellow,
border_normal: Color::Rgb(45, 45, 45),
header_desc: Color::Rgb(150, 150, 150),
},
title: TitleColors {
big_title: cyan,
author: blue,
link: green,
license: orange,
prompt: Color::Rgb(150, 150, 150),
subtitle: fg,
},
meter: MeterColors {
low: green,
mid: yellow,
high: red,
low_rgb: (70, 240, 110),
mid_rgb: (245, 220, 75),
high_rgb: (245, 75, 75),
},
sparkle: SparkleColors {
colors: [
(80, 230, 230),
(255, 160, 60),
(80, 255, 120),
(200, 120, 255),
(80, 180, 255),
],
},
confirm: ConfirmColors {
border: orange,
button_selected_bg: orange,
button_selected_fg: bg,
},
}
}