reflow-firmware3.0/src/application/styles.rs

59 lines
2.3 KiB
Rust

use embedded_graphics::{
fonts::Text, pixelcolor::Rgb565, prelude::*, primitive_style, primitives::rectangle::Rectangle,
primitives::Line, style::PrimitiveStyle, style::TextStyle, style::TextStyleBuilder, text_style,
};
use profont::{ProFont12Point, ProFont14Point};
pub struct Styles {
pub fill_black: PrimitiveStyle<Rgb565>,
pub text: TextStyle<Rgb565, ProFont12Point>,
pub text_green: TextStyle<Rgb565, ProFont12Point>,
pub text_red: TextStyle<Rgb565, ProFont12Point>,
pub text_big: TextStyle<Rgb565, ProFont14Point>,
pub text_big_black: TextStyle<Rgb565, ProFont14Point>,
pub normal_box: PrimitiveStyle<Rgb565>,
pub selected_box: PrimitiveStyle<Rgb565>,
pub ok_box: PrimitiveStyle<Rgb565>,
pub cancel_box: PrimitiveStyle<Rgb565>,
pub grid: PrimitiveStyle<Rgb565>,
pub profile_color: Rgb565,
pub temp_color: Rgb565,
}
impl Styles {
pub fn new() -> Styles {
Styles {
fill_black: primitive_style!(fill_color = Rgb565::BLACK),
text: text_style!(font = ProFont12Point, text_color = Rgb565::WHITE),
text_green: text_style!(font = ProFont12Point, text_color = Rgb565::GREEN),
text_red: text_style!(font = ProFont12Point, text_color = Rgb565::RED),
text_big: text_style!(font = ProFont14Point, text_color = Rgb565::WHITE),
text_big_black: text_style!(font = ProFont14Point, text_color = Rgb565::BLACK),
normal_box: primitive_style!(
fill_color = Rgb565::BLACK,
stroke_color = Rgb565::WHITE,
stroke_width = 1
),
selected_box: primitive_style!(
fill_color = Rgb565::BLUE,
stroke_color = Rgb565::WHITE,
stroke_width = 1
),
ok_box: primitive_style!(
fill_color = Rgb565::GREEN,
stroke_color = Rgb565::WHITE,
stroke_width = 1
),
cancel_box: primitive_style!(
fill_color = Rgb565::GREEN,
stroke_color = Rgb565::WHITE,
stroke_width = 1
),
grid: primitive_style!(stroke_color = Rgb565::new(4, 8, 4), stroke_width = 1),
profile_color: Rgb565::new(24, 48, 24),
temp_color: Rgb565::RED,
}
}
}