use termcolor::Color;
#[derive(Debug, Clone)]
pub struct Theme {
pub keyword: Color,
pub headline: Color,
pub description: Color,
pub error: Color,
pub other: Color,
}
#[macro_export]
macro_rules! construct_theme {
($kw:expr, $hd:expr, $dsc:expr, $err:expr, $othr:expr) => {
Theme {
keyword: $kw,
headline: $hd,
description: $dsc,
error: $err,
other: $othr,
}
};
}
pub enum PredefinedThemes {
Plain,
Colorful,
}
impl Theme {
pub fn new() -> Self {
use Color::*;
construct_theme!(Yellow, Cyan, White, Red, White)
}
pub fn plain() -> Self {
use Color::*;
construct_theme!(White, White, White, Red, White)
}
pub fn colorful() -> Self {
use Color::*;
construct_theme!(Green, Magenta, Blue, Red, White)
}
}
impl Default for Theme {
fn default() -> Self {
Self::new()
}
}