use crate::{
colors::{Color, SimpleColor},
impl_macros::{color_type::impl_color_type, from_to::impl_from_to},
};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum BasicColor {
Black,
Red,
Green,
Yellow,
Blue,
Magenta,
Cyan,
White,
}
impl BasicColor {
#[must_use]
pub fn bright(self) -> SimpleColor {
SimpleColor::new_bright(self)
}
#[must_use]
pub(crate) fn code_offset(self) -> u8 {
self as u8
}
}
impl_color_type!(BasicColor {
args: [self];
to_color: {
self.to_simple_color().to_color()
}
});
impl_from_to!(
#[doc = r"Convert this basic color into a [`SimpleColor`]."]
fn to_simple_color(self: BasicColor) -> SimpleColor {
SimpleColor::new(self)
}
);