ported ming-os graphics to linux framebuffer
This commit is contained in:
44
src/themes.rs
Normal file
44
src/themes.rs
Normal 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user