Skip to main content

karrycharonart/
lib.rs

1//! # Art
2//!
3//! 一个艺术概念库。
4pub use self::kinds::PrimaryColor;
5pub use self::kinds::SecondaryColor;
6pub use self::utils::mix;
7pub mod kinds {
8    /// 根据RYB颜色模型的原色
9    /// The primary colors according to the RYB color model.
10    pub enum PrimaryColor {
11        Red,
12        Yellow,
13        Blue,
14    }
15    /// 根据RYB颜色模型的第二色
16    /// The secondary colors according to the RYB color model.
17    pub enum SecondaryColor {
18        Orange,
19        Green,
20        Purple,
21    }
22}
23pub mod utils {
24    use crate::kinds::*;
25
26    /// mix函数 用于组合两个原色为第二色
27    /// # Example
28    /// ```rust
29    /// let a = 3;
30    /// let b = a;
31    /// ```
32    pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor {
33        // --snip--
34        SecondaryColor::Orange
35    }
36}
37fn main() {}