marble-machinations/src/theme.rs

25 lines
559 B
Rust
Raw Normal View History

2024-10-13 12:45:58 +02:00
use raylib::prelude::*;
pub const BG_DARK: Color = gray(32);
pub const BG_MEDIUM: Color = gray(48);
pub const BG_LIGHT: Color = gray(64);
pub const BG_WIDGET: Color = gray(96);
pub const BG_WIDGET_ACTIVE: Color = rgb(80, 120, 180);
pub const FG_MARBLE_VALUE: Color = rgb(255, 80, 40);
pub const fn widget_bg(highlight: bool) -> Color {
if highlight {
BG_WIDGET_ACTIVE
} else {
BG_WIDGET
}
}
pub const fn rgb(r: u8, g: u8, b: u8) -> Color {
Color::new(r, g, b, 255)
}
pub const fn gray(value: u8) -> Color {
Color::new(value, value, value, 255)
}