popher/lib.rs
1//! # Art
2//!
3//! A library for modeling artistic concepts
4
5pub use self::kinds::PrimaryColor;
6pub use self::kinds::SecondaryColor;
7pub use self::utils::mix;
8
9pub mod kinds {
10 /// The primary colors according to the RYB color model.
11 pub enum PrimaryColor {
12 Red,
13 Yellow,
14 Blue,
15 }
16
17 /// The secondary colors according to the RYB color model.
18 #[derive(PartialEq)]
19 pub enum SecondaryColor {
20 Orange,
21 Green,
22 Purple
23 }
24}
25
26pub mod utils {
27 use crate::kinds::*;
28
29 /// Combines two primary colors in equal amounts to create
30 /// a secondary color.
31 pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor {
32 SecondaryColor::Green
33 }
34}