rapiy_art/
lib.rs

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