Skip to content

Commit

Permalink
feat: Implement the Stylify for PaintType
Browse files Browse the repository at this point in the history
in this way we can add PaintType to list of start_styles
  • Loading branch information
Syaw0 committed Nov 2, 2024
1 parent 68b701e commit c41e8d8
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/colors.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
pub trait Stylify {
fn make_styles(&self, paint_type: Option<PaintType>) -> String;
}
pub enum PaintType {
FG,
BG,
}

pub trait Stylify {
fn make_styles(&self, paint_type: Option<PaintType>) -> String;
impl Stylify for PaintType {
fn make_styles(&self, _paint_type: Option<PaintType>) -> String {
String::new()
}
}

pub struct BasicColor {
Expand Down Expand Up @@ -43,7 +48,7 @@ pub const BRIGHT_WHITE: BasicColor = BasicColor { fg: 97, bg: 107 };
//

pub struct PaletteColor {
index: u8,
pub index: u8,
}

impl Stylify for PaletteColor {
Expand All @@ -61,9 +66,9 @@ impl Stylify for PaletteColor {
}

pub struct RGB {
r: u8,
g: u8,
b: u8,
pub r: u8,
pub g: u8,
pub b: u8,
}

impl Stylify for RGB {
Expand Down

0 comments on commit c41e8d8

Please sign in to comment.