mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-04-22 05:18:04 +08:00
35 lines
710 B
Rust
Executable File
35 lines
710 B
Rust
Executable File
// ANCHOR: here
|
|
//! # Art
|
|
//!
|
|
//! A library for modeling artistic concepts.
|
|
|
|
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 colors in equal amounts to create
|
|
/// a secondary color.
|
|
pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor {
|
|
// --snip--
|
|
// ANCHOR_END: here
|
|
unimplemented!();
|
|
// ANCHOR: here
|
|
}
|
|
}
|
|
// ANCHOR_END: here
|