use crate::geom::{Css, Rgba};
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct Theme {
pub background: Rgba,
pub text: Rgba,
pub grid: Rgba,
pub axis_line: Rgba,
pub up: Rgba,
pub down: Rgba,
pub up_wick: Rgba,
pub down_wick: Rgba,
pub volume_up: Rgba,
pub volume_down: Rgba,
pub crosshair: Rgba,
pub crosshair_label_bg: Rgba,
pub crosshair_label_text: Rgba,
pub font_size: Css,
pub axis_padding: Css,
pub line: Rgba,
}
const UP: Rgba = Rgba::hex(0x0026_A69A);
const DOWN: Rgba = Rgba::hex(0x00EF_5350);
impl Theme {
pub const fn light() -> Self {
Self {
background: Rgba::hex(0x00FF_FFFF),
text: Rgba::hex(0x001F_232B),
grid: Rgba::hex(0x00EE_F0F4),
axis_line: Rgba::hex(0x00D5_D9E0),
up: UP,
down: DOWN,
up_wick: UP,
down_wick: DOWN,
volume_up: UP.with_alpha(110),
volume_down: DOWN.with_alpha(110),
crosshair: Rgba::hex(0x0095_98A1),
crosshair_label_bg: Rgba::hex(0x0013_1722),
crosshair_label_text: Rgba::hex(0x00FF_FFFF),
font_size: Css(11.0),
axis_padding: Css(6.0),
line: Rgba::hex(0x0029_62FF),
}
}
pub const fn dark() -> Self {
Self {
background: Rgba::hex(0x0013_161C),
text: Rgba::hex(0x00C9_CDD6),
grid: Rgba::hex(0x0021_292F),
axis_line: Rgba::hex(0x003A_404A),
crosshair: Rgba::hex(0x0075_8696),
crosshair_label_bg: Rgba::hex(0x0036_3A45),
..Self::light()
}
}
}
impl Default for Theme {
fn default() -> Self {
Self::light()
}
}