1
0
Fork 0
forked from wry/wry

autocommit 2022-02-19 19:41:18 CET

This commit is contained in:
Julian Orth 2022-02-19 19:41:18 +01:00
parent bb0468feea
commit ae66acef73
32 changed files with 880 additions and 164 deletions

View file

@ -1,5 +1,4 @@
use crate::NumCell;
use std::cell::Cell;
use std::cell::{Cell, RefCell};
#[derive(Copy, Clone, Debug)]
pub struct Color {
@ -9,6 +8,15 @@ pub struct Color {
pub a: f32,
}
impl Color {
pub const RED: Self = Self {
r: 1.0,
g: 0.0,
b: 0.0,
a: 1.0,
};
}
fn to_f32(c: u8) -> f32 {
c as f32 / 255 as f32
}
@ -43,7 +51,7 @@ pub struct Theme {
pub border_color: Cell<Color>,
pub title_height: Cell<i32>,
pub border_width: Cell<i32>,
pub version: NumCell<u32>,
pub font: RefCell<String>,
}
impl Default for Theme {
@ -56,7 +64,7 @@ impl Default for Theme {
border_color: Cell::new(Color::from_rgba(0x36, 0x00, 0x07, 255)),
title_height: Cell::new(17),
border_width: Cell::new(4),
version: NumCell::new(1),
font: RefCell::new("monospace 8".to_string()),
}
}
}