metfairy_art/lib.rs
1//! # My Crate
2//!
3//! `my_crate` is a collection of utilities to make performing certain
4//! calculations more convenient.
5//!
6//! # Art
7//!
8//! A library for modeling artistic concepts.
9
10/// Adds one to the number given
11///
12/// # Examples
13/// ```
14/// let arg = 5;
15/// let answer = metfairy_art::add_one(arg);
16///
17/// assert_eq!(6,answer);
18/// ```
19
20pub fn add_one(x: i32) -> i32 {
21 x + 1
22}
23
24pub use self::kinds::PrimaryColor;
25pub use self::kinds::SecondaryColor;
26pub use self::utils::mix;
27
28pub mod kinds {
29 /// The primary colors according to the RYB color model.
30 pub enum PrimaryColor {
31 Red,
32 Yellow,
33 Blue,
34 }
35
36 /// The secondary colors according to the RYB color model.
37 pub enum SecondaryColor {
38 Orange,
39 Green,
40 Purple,
41 }
42}
43
44pub mod utils {
45 use crate::kinds::*;
46
47 /// Combines two primary colors in equal amounts to create
48 /// a secondary color.
49 pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor {
50 // --snip--
51 let sec = SecondaryColor::Green;
52 sec
53 }
54}