pub_just/
command_color.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use super::*;

#[derive(Copy, Clone, ValueEnum)]
pub enum CommandColor {
  Black,
  Blue,
  Cyan,
  Green,
  Purple,
  Red,
  Yellow,
}

impl From<CommandColor> for ansi_term::Color {
  fn from(command_color: CommandColor) -> Self {
    match command_color {
      CommandColor::Black => Self::Black,
      CommandColor::Blue => Self::Blue,
      CommandColor::Cyan => Self::Cyan,
      CommandColor::Green => Self::Green,
      CommandColor::Purple => Self::Purple,
      CommandColor::Red => Self::Red,
      CommandColor::Yellow => Self::Yellow,
    }
  }
}