diff options
| author | denis <denismaximov98@gmail.com> | 2021-03-31 09:44:41 +0300 |
|---|---|---|
| committer | denis <denismaximov98@gmail.com> | 2021-03-31 09:44:41 +0300 |
| commit | 2b59edbe9d97fce23bd3ca2716d9eb540aa77695 (patch) | |
| tree | 10c398d82bfcf4f315b818275fb2914c6a8e317a | |
| parent | wip: replace the impl with a fn load_palette instead (diff) | |
| download | sl0ppij-2b59edbe9d97fce23bd3ca2716d9eb540aa77695.tar.gz sl0ppij-2b59edbe9d97fce23bd3ca2716d9eb540aa77695.tar.xz sl0ppij-2b59edbe9d97fce23bd3ca2716d9eb540aa77695.zip | |
wip: need to set the default for Palette in the plugins
| -rw-r--r-- | src/common/input/handler.rs | 2 | ||||
| -rw-r--r-- | zellij-tile/src/data.rs | 28 |
2 files changed, 28 insertions, 2 deletions
diff --git a/src/common/input/handler.rs b/src/common/input/handler.rs index 163e5ddf..a843c7cc 100644 --- a/src/common/input/handler.rs +++ b/src/common/input/handler.rs @@ -256,7 +256,7 @@ impl InputHandler { // TODO this should probably be automatically generated in some way pub fn get_mode_info(mode: InputMode) -> ModeInfo { let mut keybinds: Vec<(String, String)> = vec![]; - let mut palette = load_palette(); + let palette = load_palette(); match mode { InputMode::Normal | InputMode::Locked => {} InputMode::Resize => { diff --git a/zellij-tile/src/data.rs b/zellij-tile/src/data.rs index 16f02531..c41a40ee 100644 --- a/zellij-tile/src/data.rs +++ b/zellij-tile/src/data.rs @@ -58,7 +58,16 @@ impl Default for InputMode { } } -#[derive(Clone, Copy, Default, Debug, Serialize, Deserialize)] +pub mod colors { + pub const WHITE: (u8, u8, u8) = (238, 238, 238); + pub const GREEN: (u8, u8, u8) = (175, 255, 0); + pub const GRAY: (u8, u8, u8) = (68, 68, 68); + pub const BRIGHT_GRAY: (u8, u8, u8) = (138, 138, 138); + pub const RED: (u8, u8, u8) = (135, 0, 0); + pub const BLACK: (u8, u8, u8) = (0, 0, 0); +} + +#[derive(Clone, Copy, Debug, Serialize, Deserialize)] pub struct Palette { pub fg: (u8, u8, u8), pub bg: (u8, u8, u8), @@ -72,6 +81,23 @@ pub struct Palette { pub white: (u8, u8, u8), } +impl Default for Palette { + fn default() -> Palette { + Palette { + fg: colors::BRIGHT_GRAY, + bg: colors::BLACK, + black: colors::BLACK, + red: colors::RED, + green: colors::GREEN, + yellow: colors::GRAY, + blue: colors::GRAY, + magenta: colors::GRAY, + cyan: colors::GRAY, + white: colors::WHITE, + } + } +} + /// Represents the contents of the help message that is printed in the status bar, /// which indicates the current [`InputMode`] and what the keybinds for that mode /// are. Related to the default `status-bar` plugin. |
