Primitive modular typography scale helpers.
These helpers keep common scale ratios explicit and deterministic.
Examples
use ;
let values = modular_scale.unwrap;
assert!;
assert!;
assert_eq!;
Primitive modular typography scale helpers.
These helpers keep common scale ratios explicit and deterministic.
use use_modular_scale::{ScaleRatio, modular_scale, scale_down, scale_up};
let values = modular_scale(16.0, ScaleRatio::MajorThird, -1, 1).unwrap();
assert!((scale_up(16.0, ScaleRatio::MajorThird, 1).unwrap() - 20.0).abs() < 1.0e-12);
assert!((scale_down(16.0, ScaleRatio::MajorThird, 1).unwrap() - 12.8).abs() < 1.0e-12);
assert_eq!(values.len(), 3);