danand_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
11
12
13pub mod kinds{
14    /// The primary colors according to the RYB color model.
15    pub enum PrimaryColor{
16        Red,
17        Yellow,
18        Blue,
19    }
20    /// The secondary colors according to the RYB color model.
21    pub enum SecondaryColor{
22        Orange,
23        Green,
24        Purple
25    }
26}
27
28pub mod utils{
29    use crate::kinds::*;
30    /// Combines two primary colors in equal amounts to create
31    /// a secondary color.
32    pub fn mix(c1: PrimaryColor, c2:PrimaryColor) -> SecondaryColor{
33        // --snip--
34        // ANCHOR_END: here
35        SecondaryColor::Orange
36        // ANCHOR: here
37    }
38}