summaryrefslogtreecommitdiff
path: root/crates/src/lib.rs
diff options
context:
space:
mode:
authorAdam Carpenter <53hornet@gmail.com>2019-03-26 15:54:52 -0400
committerAdam Carpenter <53hornet@gmail.com>2019-03-26 15:54:52 -0400
commite25482fca375d318a39c3b54db396b0db6e0b263 (patch)
tree1f7b2131fdb7c69e6e6be3bc053d283045cde98e /crates/src/lib.rs
parentb560fca37f6571c18b12d6fff4b3e86e549db6be (diff)
parent0dac5e02a0da650e20a6385c27a385d05823f80c (diff)
downloadlearning-rust-e25482fca375d318a39c3b54db396b0db6e0b263.tar.xz
learning-rust-e25482fca375d318a39c3b54db396b0db6e0b263.zip
Merge branch 'master' of gitlab.com:53hornet/learning-rust
Diffstat (limited to 'crates/src/lib.rs')
-rw-r--r--crates/src/lib.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/crates/src/lib.rs b/crates/src/lib.rs
new file mode 100644
index 0000000..5cf1d97
--- /dev/null
+++ b/crates/src/lib.rs
@@ -0,0 +1,33 @@
+//! # Art
+//!
+//! A library for modeling artistic concepts.
+
+pub use kinds::PrimaryColor;
+pub use kinds::SecondaryColor;
+pub use utils::mix;
+
+pub mod kinds {
+ /// The primary colors according to the RYB color model.
+ pub enum PrimaryColor {
+ Red,
+ Yellow,
+ Blue,
+ }
+
+ /// The secondary colors according to the RYB color model.
+ pub enum SecondaryColor {
+ Orange,
+ Green,
+ Purple,
+ }
+}
+
+pub mod utils {
+ use crate::kinds::*;
+
+ /// Combines two primary color in equal amounts to create
+ /// a secondary color.
+ pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor {
+ SecondaryColor::Green
+ }
+}