Material Design Colors for Rust
Easily get color variants based on the Material Design Pallete. All colors
are represented as 0xRRGGBB with the first two bytes not used. To access a
color you may use the const fn under [MatColor] or access the const
arrays that are publicly available. Also, check out [MatColor::new] to
create Material Design colors based on [MatColorVariant] and [MatColorAccent]
on demand.
For More information, check out the Official Website.
Examples
You may use the const fn through [MatColor] or access them through a specific color.
use ;
let red1: u32 = MatColor.red.c300;
let brown: u32 = MatColor.brown.c900;
let black: u32 = MatColor.black;
let red2 = MatColorRed.c300;
assert_eq!;
Or you may use [MatColor::new] to create colors on the fly:
use ;
let orange: = new;
assert!;
let no_brown: = new;
assert!;
You may also use global constant arrays and index them using an accent.
use ;
let red: u32 = MAT_COLORS_RED;
assert_eq!;