Skip to content

Commit

Permalink
feat: Add Clone to Styles variant structs
Browse files Browse the repository at this point in the history
  • Loading branch information
Syaw0 committed Nov 3, 2024
1 parent be0cbea commit 169ac59
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/colors.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
pub trait Stylify {
fn make_styles(&self, paint_type: Option<PaintType>) -> String;
}

#[derive(Debug, Clone)]
pub enum PaintType {
FG,
BG,
}

#[derive(Debug, Clone)]
pub enum Styles {
StyleRgb(Rgb),
StyleBasicColor(BasicColor),
Expand All @@ -30,7 +31,7 @@ impl Stylify for PaintType {
String::new()
}
}

#[derive(Debug, Clone)]
pub struct BasicColor {
fg: u8,
bg: u8,
Expand Down Expand Up @@ -65,7 +66,7 @@ pub const BRIGHT_CYAN: Styles = Styles::StyleBasicColor(BasicColor { fg: 96, bg:
pub const BRIGHT_WHITE: Styles = Styles::StyleBasicColor(BasicColor { fg: 97, bg: 107 });

//

#[derive(Debug, Clone)]
pub struct PaletteColor {
pub index: u8,
}
Expand All @@ -83,7 +84,7 @@ impl Stylify for PaletteColor {
)
}
}

#[derive(Debug, Clone)]
pub struct Rgb {
pub r: u8,
pub g: u8,
Expand Down

0 comments on commit 169ac59

Please sign in to comment.