refactor
This commit is contained in:
parent
fb4a142c9c
commit
caeac280eb
4 changed files with 12 additions and 10 deletions
|
@ -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>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue