diff options
Diffstat (limited to 'src/display/src/color_mode.rs')
-rw-r--r-- | src/display/src/color_mode.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/display/src/color_mode.rs b/src/display/src/color_mode.rs index 4887de6..da3f5d7 100644 --- a/src/display/src/color_mode.rs +++ b/src/display/src/color_mode.rs @@ -1,19 +1,32 @@ use super::color_mode::ColorMode::{EightBit, FourBit, TrueColor}; +/// Represents the color mode of a terminal interface. #[derive(Copy, Clone, Debug, PartialEq)] +#[allow(clippy::exhaustive_enums)] pub enum ColorMode { + /// Supports 2 colors. TwoTone, + /// Supports 8 colors. ThreeBit, + /// Supports 16 colors. FourBit, + /// Supports 256 colors. EightBit, + /// Supports 24 bits of color. TrueColor, } impl ColorMode { + /// Supports 4 bit or more of color. + #[inline] + #[must_use] pub fn has_minimum_four_bit_color(self) -> bool { self == FourBit || self == EightBit || self == TrueColor } + /// Has true color support. + #[inline] + #[must_use] pub fn has_true_color(self) -> bool { self == TrueColor } |