Skip to main content

ptsd/
colors.rs

1use std::fmt::{self, Display};
2
3pub enum Background {Primary, Secondary}
4
5impl Display for Background { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self {
6    Background::Primary => write!(f, "Background::Primary"),
7    Background::Secondary => write!(f, "Background::Secondary"),
8} } }
9
10pub enum Text {Primary, Secondary, Heading}
11
12impl Display for Text { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self {
13    Text::Primary => write!(f, "Text::Primary"),
14    Text::Secondary => write!(f, "Text::Secondary"),
15    Text::Heading => write!(f, "Text::Heading"),
16} } }
17
18pub enum Outline {Primary, Secondary}
19
20impl Display for Outline { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self {
21    Outline::Primary => write!(f, "Outline::Primary"),
22    Outline::Secondary => write!(f, "Outline::Secondary"),
23} } }
24
25pub enum Status {Success, Warning, Danger}
26
27impl Display for Status { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self {
28    Status::Success => write!(f, "Status::Success"),
29    Status::Warning => write!(f, "Status::Warning"),
30    Status::Danger  => write!(f, "Status::Danger"),
31} } }
32
33pub struct Brand;
34impl Display for Brand {fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {write!(f, "Brand")}}