Feat: refactoring codebase
This commit is contained in:
@@ -1,282 +1,39 @@
|
||||
use super::*;
|
||||
use ratatui::style::Color;
|
||||
use super::palette::Palette;
|
||||
|
||||
pub fn theme() -> ThemeColors {
|
||||
let bg = Color::Rgb(10, 8, 8);
|
||||
let surface = Color::Rgb(20, 16, 16);
|
||||
let surface2 = Color::Rgb(26, 20, 20);
|
||||
let border = Color::Rgb(42, 32, 32);
|
||||
let fg = Color::Rgb(232, 221, 208);
|
||||
let fg_dim = Color::Rgb(160, 144, 128);
|
||||
let fg_muted = Color::Rgb(96, 80, 64);
|
||||
|
||||
let red = Color::Rgb(224, 80, 64);
|
||||
let orange = Color::Rgb(224, 128, 48);
|
||||
let yellow = Color::Rgb(208, 160, 48);
|
||||
let green = Color::Rgb(128, 160, 80);
|
||||
let cyan = Color::Rgb(112, 160, 160);
|
||||
let purple = Color::Rgb(160, 112, 144);
|
||||
let blue = Color::Rgb(96, 128, 176);
|
||||
|
||||
ThemeColors {
|
||||
ui: UiColors {
|
||||
bg,
|
||||
bg_rgb: (10, 8, 8),
|
||||
text_primary: fg,
|
||||
text_muted: fg_dim,
|
||||
text_dim: fg_muted,
|
||||
border,
|
||||
header: orange,
|
||||
unfocused: fg_muted,
|
||||
accent: orange,
|
||||
surface,
|
||||
},
|
||||
status: StatusColors {
|
||||
playing_bg: Color::Rgb(20, 28, 16),
|
||||
playing_fg: green,
|
||||
stopped_bg: Color::Rgb(40, 16, 14),
|
||||
stopped_fg: red,
|
||||
fill_on: orange,
|
||||
fill_off: fg_muted,
|
||||
fill_bg: surface,
|
||||
},
|
||||
selection: SelectionColors {
|
||||
cursor_bg: orange,
|
||||
cursor_fg: bg,
|
||||
selected_bg: Color::Rgb(50, 35, 20),
|
||||
selected_fg: orange,
|
||||
in_range_bg: Color::Rgb(35, 25, 18),
|
||||
in_range_fg: fg,
|
||||
cursor: orange,
|
||||
selected: Color::Rgb(50, 35, 20),
|
||||
in_range: Color::Rgb(35, 25, 18),
|
||||
},
|
||||
tile: TileColors {
|
||||
playing_active_bg: Color::Rgb(45, 25, 15),
|
||||
playing_active_fg: orange,
|
||||
playing_inactive_bg: Color::Rgb(40, 32, 12),
|
||||
playing_inactive_fg: yellow,
|
||||
active_bg: Color::Rgb(20, 30, 30),
|
||||
active_fg: cyan,
|
||||
content_bg: Color::Rgb(27, 37, 37),
|
||||
inactive_bg: surface,
|
||||
inactive_fg: fg_dim,
|
||||
active_selected_bg: Color::Rgb(40, 30, 35),
|
||||
active_in_range_bg: Color::Rgb(30, 25, 25),
|
||||
link_bright: [
|
||||
(224, 128, 48),
|
||||
(224, 80, 64),
|
||||
(208, 160, 48),
|
||||
(112, 160, 160),
|
||||
(128, 160, 80),
|
||||
],
|
||||
link_dim: [
|
||||
(45, 28, 14),
|
||||
(45, 18, 14),
|
||||
(42, 32, 12),
|
||||
(22, 32, 32),
|
||||
(26, 32, 18),
|
||||
],
|
||||
},
|
||||
header: HeaderColors {
|
||||
tempo_bg: Color::Rgb(40, 28, 30),
|
||||
tempo_fg: purple,
|
||||
bank_bg: Color::Rgb(22, 30, 40),
|
||||
bank_fg: blue,
|
||||
pattern_bg: Color::Rgb(22, 34, 34),
|
||||
pattern_fg: cyan,
|
||||
stats_bg: surface,
|
||||
stats_fg: fg_dim,
|
||||
},
|
||||
modal: ModalColors {
|
||||
border: orange,
|
||||
border_accent: red,
|
||||
border_warn: yellow,
|
||||
border_dim: fg_muted,
|
||||
confirm: red,
|
||||
rename: orange,
|
||||
input: cyan,
|
||||
editor: orange,
|
||||
preview: fg_muted,
|
||||
},
|
||||
flash: FlashColors {
|
||||
error_bg: Color::Rgb(50, 16, 14),
|
||||
error_fg: red,
|
||||
success_bg: Color::Rgb(20, 35, 18),
|
||||
success_fg: green,
|
||||
info_bg: surface,
|
||||
info_fg: fg,
|
||||
},
|
||||
list: ListColors {
|
||||
playing_bg: Color::Rgb(20, 35, 18),
|
||||
playing_fg: green,
|
||||
staged_play_bg: Color::Rgb(35, 25, 30),
|
||||
staged_play_fg: purple,
|
||||
staged_stop_bg: Color::Rgb(45, 18, 16),
|
||||
staged_stop_fg: red,
|
||||
edit_bg: Color::Rgb(20, 32, 32),
|
||||
edit_fg: cyan,
|
||||
hover_bg: surface2,
|
||||
hover_fg: fg,
|
||||
muted_bg: Color::Rgb(18, 14, 14),
|
||||
muted_fg: fg_muted,
|
||||
soloed_bg: Color::Rgb(40, 32, 12),
|
||||
soloed_fg: yellow,
|
||||
},
|
||||
link_status: LinkStatusColors {
|
||||
disabled: red,
|
||||
connected: green,
|
||||
listening: yellow,
|
||||
},
|
||||
syntax: SyntaxColors {
|
||||
gap_bg: bg,
|
||||
executed_bg: Color::Rgb(25, 18, 14),
|
||||
selected_bg: Color::Rgb(45, 30, 15),
|
||||
emit: (fg, Color::Rgb(45, 20, 18)),
|
||||
number: (yellow, Color::Rgb(40, 30, 12)),
|
||||
string: (green, Color::Rgb(25, 30, 18)),
|
||||
comment: (fg_muted, bg),
|
||||
keyword: (red, Color::Rgb(42, 18, 15)),
|
||||
stack_op: (blue, Color::Rgb(22, 28, 38)),
|
||||
operator: (orange, Color::Rgb(42, 26, 12)),
|
||||
sound: (cyan, Color::Rgb(22, 32, 32)),
|
||||
param: (purple, Color::Rgb(32, 24, 28)),
|
||||
context: (orange, Color::Rgb(42, 26, 12)),
|
||||
note: (green, Color::Rgb(25, 30, 18)),
|
||||
interval: (Color::Rgb(150, 180, 100), Color::Rgb(28, 34, 20)),
|
||||
variable: (purple, Color::Rgb(32, 24, 28)),
|
||||
vary: (yellow, Color::Rgb(40, 30, 12)),
|
||||
generator: (cyan, Color::Rgb(22, 32, 30)),
|
||||
user_defined: (purple, Color::Rgb(28, 20, 26)),
|
||||
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(45, 30, 20),
|
||||
selected_fg: fg,
|
||||
unselected_bg: surface,
|
||||
unselected_fg: fg_muted,
|
||||
},
|
||||
editor_widget: EditorWidgetColors {
|
||||
cursor_bg: fg,
|
||||
cursor_fg: bg,
|
||||
selection_bg: Color::Rgb(50, 35, 25),
|
||||
completion_bg: surface,
|
||||
completion_fg: fg,
|
||||
completion_selected: orange,
|
||||
completion_example: cyan,
|
||||
},
|
||||
browser: BrowserColors {
|
||||
directory: blue,
|
||||
project_file: orange,
|
||||
selected: red,
|
||||
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: orange,
|
||||
cursor: fg,
|
||||
hint: fg_muted,
|
||||
},
|
||||
search: SearchColors {
|
||||
active: orange,
|
||||
inactive: fg_muted,
|
||||
match_bg: yellow,
|
||||
match_fg: bg,
|
||||
},
|
||||
markdown: MarkdownColors {
|
||||
h1: orange,
|
||||
h2: red,
|
||||
h3: purple,
|
||||
code: green,
|
||||
code_border: Color::Rgb(50, 38, 38),
|
||||
link: cyan,
|
||||
link_url: Color::Rgb(80, 68, 56),
|
||||
quote: fg_muted,
|
||||
text: fg,
|
||||
list: fg,
|
||||
},
|
||||
engine: EngineColors {
|
||||
header: orange,
|
||||
header_focused: yellow,
|
||||
divider: Color::Rgb(38, 30, 30),
|
||||
scroll_indicator: Color::Rgb(55, 42, 42),
|
||||
label: Color::Rgb(130, 115, 100),
|
||||
label_focused: Color::Rgb(170, 155, 140),
|
||||
label_dim: Color::Rgb(90, 76, 64),
|
||||
value: Color::Rgb(200, 188, 175),
|
||||
focused: yellow,
|
||||
normal: fg,
|
||||
dim: Color::Rgb(55, 42, 42),
|
||||
path: Color::Rgb(130, 115, 100),
|
||||
border_magenta: purple,
|
||||
border_green: green,
|
||||
border_cyan: cyan,
|
||||
separator: Color::Rgb(38, 30, 30),
|
||||
hint_active: orange,
|
||||
hint_inactive: Color::Rgb(38, 30, 30),
|
||||
},
|
||||
dict: DictColors {
|
||||
word_name: green,
|
||||
word_bg: Color::Rgb(22, 28, 22),
|
||||
alias: fg_muted,
|
||||
stack_sig: purple,
|
||||
description: fg,
|
||||
example: Color::Rgb(130, 115, 100),
|
||||
category_focused: yellow,
|
||||
category_selected: orange,
|
||||
category_normal: fg,
|
||||
category_dimmed: Color::Rgb(55, 42, 42),
|
||||
border_focused: yellow,
|
||||
border_normal: Color::Rgb(38, 30, 30),
|
||||
header_desc: Color::Rgb(145, 130, 115),
|
||||
},
|
||||
title: TitleColors {
|
||||
big_title: orange,
|
||||
author: red,
|
||||
link: cyan,
|
||||
license: yellow,
|
||||
prompt: Color::Rgb(130, 115, 100),
|
||||
subtitle: fg,
|
||||
},
|
||||
meter: MeterColors {
|
||||
low: green,
|
||||
mid: yellow,
|
||||
high: red,
|
||||
low_rgb: (128, 160, 80),
|
||||
mid_rgb: (208, 160, 48),
|
||||
high_rgb: (224, 80, 64),
|
||||
},
|
||||
sparkle: SparkleColors {
|
||||
colors: [
|
||||
(224, 128, 48),
|
||||
(224, 80, 64),
|
||||
(208, 160, 48),
|
||||
(112, 160, 160),
|
||||
(128, 160, 80),
|
||||
],
|
||||
},
|
||||
confirm: ConfirmColors {
|
||||
border: red,
|
||||
button_selected_bg: orange,
|
||||
button_selected_fg: bg,
|
||||
},
|
||||
pub fn palette() -> Palette {
|
||||
Palette {
|
||||
bg: (10, 8, 8),
|
||||
surface: (20, 16, 16),
|
||||
surface2: (42, 32, 32),
|
||||
fg: (232, 221, 208),
|
||||
fg_dim: (160, 144, 128),
|
||||
fg_muted: (96, 80, 64),
|
||||
accent: (224, 128, 48), // orange
|
||||
red: (224, 80, 64),
|
||||
green: (128, 160, 80),
|
||||
yellow: (208, 160, 48),
|
||||
blue: (96, 128, 176),
|
||||
purple: (160, 112, 144),
|
||||
cyan: (112, 160, 160),
|
||||
orange: (224, 128, 48),
|
||||
tempo_color: (160, 112, 144),
|
||||
bank_color: (96, 128, 176),
|
||||
pattern_color: (112, 160, 160),
|
||||
title_accent: (224, 128, 48),
|
||||
title_author: (224, 80, 64),
|
||||
secondary: (160, 112, 144),
|
||||
link_bright: [
|
||||
(224, 128, 48), (224, 80, 64), (208, 160, 48),
|
||||
(112, 160, 160), (128, 160, 80),
|
||||
],
|
||||
link_dim: [
|
||||
(45, 28, 14), (45, 18, 14), (42, 32, 12),
|
||||
(22, 32, 32), (26, 32, 18),
|
||||
],
|
||||
sparkle: [
|
||||
(224, 128, 48), (224, 80, 64), (208, 160, 48),
|
||||
(112, 160, 160), (128, 160, 80),
|
||||
],
|
||||
meter: [(128, 160, 80), (208, 160, 48), (224, 80, 64)],
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user