use macroquad::prelude::Color;
use macroquad::text::{load_ttf_font_from_bytes, Font};
pub const PAPER: Color = Color::new(0.957, 0.945, 0.902, 1.0);
pub const INK: Color = Color::new(0.098, 0.090, 0.078, 1.0);
pub const ACCENT: Color = Color::new(0.659, 0.224, 0.180, 1.0);
pub const BLUE: Color = Color::new(0.180, 0.290, 0.400, 1.0);
pub const FADED: Color = Color::new(0.541, 0.514, 0.459, 1.0);
pub const PAPER_SHADE: Color = Color::new(0.914, 0.898, 0.847, 1.0);
pub const MASTHEAD_LEFT: &str = "SYSTEMS ยท WEEKLY";
pub const MASTHEAD_RIGHT: &str = "PRICE: ONE STAR";
pub struct Fonts {
pub serif: Option<Font>,
pub mono: Option<Font>,
pub mono_bold: Option<Font>,
}
impl Fonts {
pub fn load() -> Fonts {
Fonts {
serif: load_ttf_font_from_bytes(include_bytes!(
"../assets/fonts/PlayfairDisplay-Bold.ttf"
))
.ok(),
mono: load_ttf_font_from_bytes(include_bytes!(
"../assets/fonts/IBMPlexMono-Regular.ttf"
))
.ok(),
mono_bold: load_ttf_font_from_bytes(include_bytes!(
"../assets/fonts/IBMPlexMono-Bold.ttf"
))
.ok(),
}
}
}
pub fn with_opacity(c: Color, opacity: f32) -> Color {
Color::new(c.r, c.g, c.b, c.a * opacity)
}