pub use self::kinds::PrimaryLight;
pub use self::kinds::SecondaryLight;
pub use self::utils::mix;
pub mod kinds {
pub enum PrimaryLight {
Red,
Green,
Blue,
}
pub enum SecondaryLight {
Undefined,
Cyan,
Magenta,
Yellow,
}
}
pub mod utils {
use crate::kinds::*;
pub fn mix(l1: PrimaryLight, l2: PrimaryLight) -> SecondaryLight {
match (l1, l2) {
(PrimaryLight::Red, PrimaryLight::Green) | (PrimaryLight::Green, PrimaryLight::Red) => SecondaryLight::Yellow,
(PrimaryLight::Red, PrimaryLight::Blue) | (PrimaryLight::Blue, PrimaryLight::Red) => SecondaryLight::Magenta,
(PrimaryLight::Green, PrimaryLight::Blue) | (PrimaryLight::Blue, PrimaryLight::Green) => SecondaryLight::Cyan,
(_, _) => SecondaryLight::Undefined,
}
}
}