rust_tutorial_art/
lib.rs

1
2
3//! # Art
4//! 
5//! A library for modeling artistic concepts.
6
7pub use self::kinds::PrimaryColor;
8pub use self::kinds::SecondaryColor;
9pub use self::utils::mix;
10
11pub mod kinds {
12    /// The primary colors according to the RYB color model.
13    pub enum PrimaryColor {
14        Red,
15        Yellow,
16        Blue,
17    }
18
19    /// The secondary colors according to the RYB color model.
20    pub enum SecondaryColor {
21        Orange,
22        Green,
23        Purple,
24    }
25}
26
27
28pub mod utils {
29    use crate::kinds::*;
30
31    /// Combines two primary colors in equal amounts to create
32    /// a secondary color.
33    pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor {
34        // --snip--
35        SecondaryColor::Green
36    }
37}
38
39
40
41
42
43
44
45
46#[cfg(test)]
47mod tests {
48    use super::*;
49
50    #[test]
51    fn it_works() {
52    }
53}