notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

colors.rs (3908B)


      1 use egui::Color32;
      2 
      3 pub const PURPLE: Color32 = Color32::from_rgb(0xCC, 0x43, 0xC5);
      4 const PURPLE_ALT: Color32 = Color32::from_rgb(0x82, 0x56, 0xDD);
      5 // TODO: This should not be exposed publicly
      6 pub const PINK: Color32 = Color32::from_rgb(0xE4, 0x5A, 0xC9);
      7 //pub const DARK_BG: Color32 = egui::Color32::from_rgb(40, 44, 52);
      8 pub const GRAY_SECONDARY: Color32 = Color32::from_rgb(0x8A, 0x8A, 0x8A);
      9 const BLACK: Color32 = Color32::from_rgb(0x00, 0x00, 0x00);
     10 const RED_700: Color32 = Color32::from_rgb(0xC7, 0x37, 0x5A);
     11 //const ORANGE_700: Color32 = Color32::from_rgb(0xF6, 0xB1, 0x4A);
     12 
     13 // BACKGROUNDS
     14 const SEMI_DARKER_BG: Color32 = Color32::from_rgb(0x39, 0x39, 0x39);
     15 const DARKER_BG: Color32 = Color32::from_rgb(0x1F, 0x1F, 0x1F);
     16 const DARK_BG: Color32 = Color32::from_rgb(0x2C, 0x2C, 0x2C);
     17 const DARK_ISH_BG: Color32 = Color32::from_rgb(0x25, 0x25, 0x25);
     18 const SEMI_DARK_BG: Color32 = Color32::from_rgb(0x44, 0x44, 0x44);
     19 
     20 const LIGHTER_GRAY: Color32 = Color32::from_rgb(0xf8, 0xf8, 0xf8);
     21 const LIGHT_GRAY: Color32 = Color32::from_rgb(0xc8, 0xc8, 0xc8); // 78%
     22 pub const MID_GRAY: Color32 = Color32::from_rgb(0xbd, 0xbd, 0xbd);
     23 const DARKER_GRAY: Color32 = Color32::from_rgb(0xa5, 0xa5, 0xa5); // 65%
     24 const EVEN_DARKER_GRAY: Color32 = Color32::from_rgb(0x89, 0x89, 0x89); // 54%
     25 
     26 pub struct ColorTheme {
     27     // VISUALS
     28     pub panel_fill: Color32,
     29     pub extreme_bg_color: Color32,
     30     pub text_color: Color32,
     31     pub err_fg_color: Color32,
     32     //pub warn_fg_color: Color32,
     33     pub hyperlink_color: Color32,
     34     pub selection_color: Color32,
     35 
     36     // WINDOW
     37     pub window_fill: Color32,
     38     pub window_stroke_color: Color32,
     39 
     40     // NONINTERACTIVE WIDGET
     41     pub noninteractive_bg_fill: Color32,
     42     pub noninteractive_weak_bg_fill: Color32,
     43     pub noninteractive_bg_stroke_color: Color32,
     44     pub noninteractive_fg_stroke_color: Color32,
     45 
     46     // INACTIVE WIDGET
     47     pub inactive_bg_stroke_color: Color32,
     48     pub inactive_bg_fill: Color32,
     49     pub inactive_weak_bg_fill: Color32,
     50 }
     51 
     52 pub fn desktop_dark_color_theme() -> ColorTheme {
     53     ColorTheme {
     54         // VISUALS
     55         panel_fill: DARKER_BG,
     56         extreme_bg_color: DARK_ISH_BG,
     57         text_color: Color32::WHITE,
     58         err_fg_color: RED_700,
     59         //warn_fg_color: ORANGE_700,
     60         hyperlink_color: PURPLE,
     61         selection_color: PURPLE_ALT,
     62 
     63         // WINDOW
     64         window_fill: DARK_ISH_BG,
     65         window_stroke_color: DARK_BG,
     66 
     67         // NONINTERACTIVE WIDGET
     68         noninteractive_bg_fill: DARK_ISH_BG,
     69         noninteractive_weak_bg_fill: DARK_BG,
     70         noninteractive_bg_stroke_color: SEMI_DARKER_BG,
     71         noninteractive_fg_stroke_color: GRAY_SECONDARY,
     72 
     73         // INACTIVE WIDGET
     74         inactive_bg_stroke_color: SEMI_DARKER_BG,
     75         inactive_bg_fill: Color32::from_rgb(0x25, 0x25, 0x25),
     76         inactive_weak_bg_fill: SEMI_DARK_BG,
     77     }
     78 }
     79 
     80 pub fn mobile_dark_color_theme() -> ColorTheme {
     81     ColorTheme {
     82         panel_fill: Color32::BLACK,
     83         noninteractive_weak_bg_fill: Color32::from_rgb(0x1F, 0x1F, 0x1F),
     84         ..desktop_dark_color_theme()
     85     }
     86 }
     87 
     88 pub fn light_color_theme() -> ColorTheme {
     89     ColorTheme {
     90         // VISUALS
     91         panel_fill: Color32::WHITE,
     92         extreme_bg_color: LIGHTER_GRAY,
     93         text_color: BLACK,
     94         err_fg_color: RED_700,
     95         //warn_fg_color: ORANGE_700,
     96         hyperlink_color: PURPLE,
     97         selection_color: PURPLE_ALT,
     98 
     99         // WINDOW
    100         window_fill: Color32::WHITE,
    101         window_stroke_color: DARKER_GRAY,
    102 
    103         // NONINTERACTIVE WIDGET
    104         noninteractive_bg_fill: Color32::WHITE,
    105         noninteractive_weak_bg_fill: LIGHTER_GRAY,
    106         noninteractive_bg_stroke_color: LIGHT_GRAY,
    107         noninteractive_fg_stroke_color: GRAY_SECONDARY,
    108 
    109         // INACTIVE WIDGET
    110         inactive_bg_stroke_color: EVEN_DARKER_GRAY,
    111         inactive_bg_fill: LIGHT_GRAY,
    112         inactive_weak_bg_fill: EVEN_DARKER_GRAY,
    113     }
    114 }