diff --git a/src/color/mod.rs b/src/color/mod.rs index bdc8b93..1dd3c83 100644 --- a/src/color/mod.rs +++ b/src/color/mod.rs @@ -1,3 +1,19 @@ +//! A color is internally represented as either RGBA or HSLA. +//! Colors can be constructed in SASS through names (e.g. red, blue, aqua) +//! or the builtin functions `rgb()`, `rgba()`, `hsl()`, and `hsla()`, +//! all of which can accept 1-4 arguments. +//! +//! It is necessary to retain the original values with which the +//! color was constructed. +//! E.g. `hsla(.999999999999, 100, 100, 1)` should retain its full +//! values to an arbitrary precision. +//! +//! Named colors are created using RGB values +//! E.g. `red` = `rgba(255, 0, 0, 1)` +//! +//! In addition, named colors retain their original casing, +//! so `rEd` should be emitted as `rEd`. + use std::convert::TryFrom; use std::fmt::{self, Display}; diff --git a/src/color/name.rs b/src/color/name.rs index 2ee359d..484b13f 100644 --- a/src/color/name.rs +++ b/src/color/name.rs @@ -1,3 +1,6 @@ +//! A big dictionary of named colors and their +//! corresponding RGBA values + use std::convert::TryFrom; use std::fmt::{self, Display}; diff --git a/src/unit/conversion.rs b/src/unit/conversion.rs index 186f6c9..9e3977d 100644 --- a/src/unit/conversion.rs +++ b/src/unit/conversion.rs @@ -1,3 +1,7 @@ +//! A big dictionary of units and their conversion ratios. +//! +//! Arbitrary precision is retained. + use std::collections::HashMap; use std::f64::consts::PI; use std::string::ToString;