notedeck

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

colors.rs (3971B)


      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 pub const ALMOST_WHITE: Color32 = Color32::from_rgb(0xFA, 0xFA, 0xFA);
     26 
     27 pub struct ColorTheme {
     28     // VISUALS
     29     pub panel_fill: Color32,
     30     pub extreme_bg_color: Color32,
     31     pub text_color: Color32,
     32     pub err_fg_color: Color32,
     33     pub warn_fg_color: Color32,
     34     pub hyperlink_color: Color32,
     35     pub selection_color: Color32,
     36 
     37     // WINDOW
     38     pub window_fill: Color32,
     39     pub window_stroke_color: Color32,
     40 
     41     // NONINTERACTIVE WIDGET
     42     pub noninteractive_bg_fill: Color32,
     43     pub noninteractive_weak_bg_fill: Color32,
     44     pub noninteractive_bg_stroke_color: Color32,
     45     pub noninteractive_fg_stroke_color: Color32,
     46 
     47     // INACTIVE WIDGET
     48     pub inactive_bg_stroke_color: Color32,
     49     pub inactive_bg_fill: Color32,
     50     pub inactive_weak_bg_fill: Color32,
     51 }
     52 
     53 pub fn desktop_dark_color_theme() -> ColorTheme {
     54     ColorTheme {
     55         // VISUALS
     56         panel_fill: DARKER_BG,
     57         extreme_bg_color: DARK_ISH_BG,
     58         text_color: Color32::WHITE,
     59         err_fg_color: RED_700,
     60         warn_fg_color: ORANGE_700,
     61         hyperlink_color: PURPLE,
     62         selection_color: PURPLE_ALT,
     63 
     64         // WINDOW
     65         window_fill: DARK_ISH_BG,
     66         window_stroke_color: DARK_BG,
     67 
     68         // NONINTERACTIVE WIDGET
     69         noninteractive_bg_fill: DARK_ISH_BG,
     70         noninteractive_weak_bg_fill: DARK_BG,
     71         noninteractive_bg_stroke_color: SEMI_DARKER_BG,
     72         noninteractive_fg_stroke_color: GRAY_SECONDARY,
     73 
     74         // INACTIVE WIDGET
     75         inactive_bg_stroke_color: SEMI_DARKER_BG,
     76         inactive_bg_fill: Color32::from_rgb(0x25, 0x25, 0x25),
     77         inactive_weak_bg_fill: SEMI_DARK_BG,
     78     }
     79 }
     80 
     81 pub fn mobile_dark_color_theme() -> ColorTheme {
     82     ColorTheme {
     83         panel_fill: Color32::BLACK,
     84         noninteractive_weak_bg_fill: Color32::from_rgb(0x1F, 0x1F, 0x1F),
     85         ..desktop_dark_color_theme()
     86     }
     87 }
     88 
     89 pub fn light_color_theme() -> ColorTheme {
     90     ColorTheme {
     91         // VISUALS
     92         panel_fill: Color32::WHITE,
     93         extreme_bg_color: LIGHTER_GRAY,
     94         text_color: BLACK,
     95         err_fg_color: RED_700,
     96         warn_fg_color: ORANGE_700,
     97         hyperlink_color: PURPLE,
     98         selection_color: PURPLE_ALT,
     99 
    100         // WINDOW
    101         window_fill: Color32::WHITE,
    102         window_stroke_color: DARKER_GRAY,
    103 
    104         // NONINTERACTIVE WIDGET
    105         noninteractive_bg_fill: Color32::WHITE,
    106         noninteractive_weak_bg_fill: LIGHTER_GRAY,
    107         noninteractive_bg_stroke_color: LIGHT_GRAY,
    108         noninteractive_fg_stroke_color: GRAY_SECONDARY,
    109 
    110         // INACTIVE WIDGET
    111         inactive_bg_stroke_color: EVEN_DARKER_GRAY,
    112         inactive_bg_fill: LIGHT_GRAY,
    113         inactive_weak_bg_fill: EVEN_DARKER_GRAY,
    114     }
    115 }