This commit is contained in:
JMARyA 2025-01-21 18:00:48 +01:00
parent fb4a142c9c
commit caeac280eb
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
4 changed files with 12 additions and 10 deletions

View file

@ -12,7 +12,18 @@ pub trait ColorCircle {
fn next(&self) -> Self;
}
// todo : specific colors rgb -[#50d71e]
#[allow(non_snake_case)]
pub fn RGB(r: u8, g: u8, b: u8) -> RGBColor {
RGBColor(format!("[#{r:02x}{g:02x}{b:02x}]"))
}
pub struct RGBColor(String);
impl UIColor for RGBColor {
fn color_class(&self) -> &str {
self.0.as_ref()
}
}
macro_rules! color_map {
($name:ident, $id:literal) => {
@ -134,8 +145,6 @@ impl UIColor for Colors {
}
}
// TODO : Gradient
pub struct Gradient {
start: Box<dyn UIColor>,
middle: Option<Box<dyn UIColor>>,