2023-06-19 19:21:05 -04:00
|
|
|
|
|
|
|
use termion::color::{ Fg, Rgb, Reset };
|
|
|
|
|
2023-06-19 20:08:05 -04:00
|
|
|
pub type Color = Fg<Rgb>;
|
|
|
|
pub type Colors = Vec<Fg<Rgb>>;
|
|
|
|
|
|
|
|
pub static BLACK: Color = Fg(Rgb(0x00, 0x00, 0x00));
|
|
|
|
pub static WHITE: Color = Fg(Rgb(0xFF, 0xFF, 0xFF));
|
2023-06-19 19:21:05 -04:00
|
|
|
|
|
|
|
pub static RESET: Fg<Reset> = Fg(Reset);
|
|
|
|
|
2023-06-19 20:31:30 -04:00
|
|
|
pub fn rgb(hex: u32) -> Color {
|
|
|
|
let [_, r, g, b] = hex.to_be_bytes();
|
|
|
|
|
|
|
|
Fg(Rgb(r, g, b))
|
|
|
|
}
|
|
|
|
|