ported ming-os graphics to linux framebuffer

This commit is contained in:
stjet
2024-10-12 06:18:05 +00:00
commit f595d4f43c
97 changed files with 2370 additions and 0 deletions

44
src/themes.rs Normal file
View File

@@ -0,0 +1,44 @@
use crate::framebuffer::RGBColor;
#[derive(PartialEq, Default)]
pub enum Themes {
#[default]
Standard,
//
}
pub struct ThemeInfo {
pub top: RGBColor,
pub background: RGBColor,
pub border_left_top: RGBColor,
pub border_right_bottom: RGBColor,
pub text: RGBColor,
pub text_top: RGBColor,
pub alt_background: RGBColor,
pub alt_text: RGBColor,
//
}
const THEME_INFOS: [(Themes, ThemeInfo); 1] = [
(Themes::Standard, ThemeInfo {
top: [0, 0, 128],
background: [192, 192, 192],
border_left_top: [255, 255, 255],
border_right_bottom: [0, 0, 0],
text: [0, 0, 0],
text_top: [255, 255, 255],
alt_background: [0, 0, 0],
alt_text: [255, 255, 255],
//
}),
];
pub fn get_theme_info(theme: &Themes) -> Option<ThemeInfo> {
for pair in THEME_INFOS {
if &pair.0 == theme {
return Some(pair.1);
}
}
return None;
}