Skip to content

Material component library

ayu

A Leptos component showcase on Material Design, with its own HCT colour toning algorithm.

// Same hue, new tone: move through HCT, not RGB
let hct = Hct::from_rgb(seed);
let palette: Vec<Rgb> = [10, 20, 40, 60, 80, 90, 95]
    .iter()
    .map(|&t| hct.with_tone(t as f64).to_rgb())
    .collect();

A component showcase for Leptos, styled with Tailwind and based on Material Design.

The interesting part is colour: a custom implementation of an HCT (hue, chroma, tone) colour space with nalgebra. Given an RGB seed it produces lighter and darker tonal variants that keep the hue, which plain RGB or HSL arithmetic doesn't.