use crate::Color;
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct MaterialColor {
primary: Color,
shades: &'static [(u16, Color)],
}
impl MaterialColor {
pub const fn new(primary: Color, shades: &'static [(u16, Color)]) -> Self {
Self { primary, shades }
}
pub const fn primary(self) -> Color {
self.primary
}
pub fn shade(self, step: u16) -> Option<Color> {
self.shades
.iter()
.find(|(s, _)| *s == step)
.map(|(_, c)| *c)
}
pub fn shade_or_primary(self, step: u16) -> Color {
self.shade(step).unwrap_or(self.primary)
}
pub fn steps(self) -> impl Iterator<Item = (u16, Color)> {
self.shades.iter().copied()
}
pub fn len(self) -> usize {
self.shades.len()
}
pub fn is_empty(self) -> bool {
self.shades.is_empty()
}
}
impl From<MaterialColor> for Color {
fn from(ramp: MaterialColor) -> Color {
ramp.primary
}
}
#[rustfmt::skip]
const RED_SHADES: &[(u16, Color)] = &[
(50, Color::from_argb_u32(0xFFFFEBEE)),
(100, Color::from_argb_u32(0xFFFFCDD2)),
(200, Color::from_argb_u32(0xFFEF9A9A)),
(300, Color::from_argb_u32(0xFFE57373)),
(400, Color::from_argb_u32(0xFFEF5350)),
(500, Color::from_argb_u32(0xFFF44336)),
(600, Color::from_argb_u32(0xFFE53935)),
(700, Color::from_argb_u32(0xFFD32F2F)),
(800, Color::from_argb_u32(0xFFC62828)),
(900, Color::from_argb_u32(0xFFB71C1C)),
];
#[rustfmt::skip]
const PINK_SHADES: &[(u16, Color)] = &[
(50, Color::from_argb_u32(0xFFFCE4EC)),
(100, Color::from_argb_u32(0xFFF8BBD0)),
(200, Color::from_argb_u32(0xFFF48FB1)),
(300, Color::from_argb_u32(0xFFF06292)),
(400, Color::from_argb_u32(0xFFEC407A)),
(500, Color::from_argb_u32(0xFFE91E63)),
(600, Color::from_argb_u32(0xFFD81B60)),
(700, Color::from_argb_u32(0xFFC2185B)),
(800, Color::from_argb_u32(0xFFAD1457)),
(900, Color::from_argb_u32(0xFF880E4F)),
];
#[rustfmt::skip]
const PURPLE_SHADES: &[(u16, Color)] = &[
(50, Color::from_argb_u32(0xFFF3E5F5)),
(100, Color::from_argb_u32(0xFFE1BEE7)),
(200, Color::from_argb_u32(0xFFCE93D8)),
(300, Color::from_argb_u32(0xFFBA68C8)),
(400, Color::from_argb_u32(0xFFAB47BC)),
(500, Color::from_argb_u32(0xFF9C27B0)),
(600, Color::from_argb_u32(0xFF8E24AA)),
(700, Color::from_argb_u32(0xFF7B1FA2)),
(800, Color::from_argb_u32(0xFF6A1B9A)),
(900, Color::from_argb_u32(0xFF4A148C)),
];
#[rustfmt::skip]
const DEEP_PURPLE_SHADES: &[(u16, Color)] = &[
(50, Color::from_argb_u32(0xFFEDE7F6)),
(100, Color::from_argb_u32(0xFFD1C4E9)),
(200, Color::from_argb_u32(0xFFB39DDB)),
(300, Color::from_argb_u32(0xFF9575CD)),
(400, Color::from_argb_u32(0xFF7E57C2)),
(500, Color::from_argb_u32(0xFF673AB7)),
(600, Color::from_argb_u32(0xFF5E35B1)),
(700, Color::from_argb_u32(0xFF512DA8)),
(800, Color::from_argb_u32(0xFF4527A0)),
(900, Color::from_argb_u32(0xFF311B92)),
];
#[rustfmt::skip]
const INDIGO_SHADES: &[(u16, Color)] = &[
(50, Color::from_argb_u32(0xFFE8EAF6)),
(100, Color::from_argb_u32(0xFFC5CAE9)),
(200, Color::from_argb_u32(0xFF9FA8DA)),
(300, Color::from_argb_u32(0xFF7986CB)),
(400, Color::from_argb_u32(0xFF5C6BC0)),
(500, Color::from_argb_u32(0xFF3F51B5)),
(600, Color::from_argb_u32(0xFF3949AB)),
(700, Color::from_argb_u32(0xFF303F9F)),
(800, Color::from_argb_u32(0xFF283593)),
(900, Color::from_argb_u32(0xFF1A237E)),
];
#[rustfmt::skip]
const BLUE_SHADES: &[(u16, Color)] = &[
(50, Color::from_argb_u32(0xFFE3F2FD)),
(100, Color::from_argb_u32(0xFFBBDEFB)),
(200, Color::from_argb_u32(0xFF90CAF9)),
(300, Color::from_argb_u32(0xFF64B5F6)),
(400, Color::from_argb_u32(0xFF42A5F5)),
(500, Color::from_argb_u32(0xFF2196F3)),
(600, Color::from_argb_u32(0xFF1E88E5)),
(700, Color::from_argb_u32(0xFF1976D2)),
(800, Color::from_argb_u32(0xFF1565C0)),
(900, Color::from_argb_u32(0xFF0D47A1)),
];
#[rustfmt::skip]
const LIGHT_BLUE_SHADES: &[(u16, Color)] = &[
(50, Color::from_argb_u32(0xFFE1F5FE)),
(100, Color::from_argb_u32(0xFFB3E5FC)),
(200, Color::from_argb_u32(0xFF81D4FA)),
(300, Color::from_argb_u32(0xFF4FC3F7)),
(400, Color::from_argb_u32(0xFF29B6F6)),
(500, Color::from_argb_u32(0xFF03A9F4)),
(600, Color::from_argb_u32(0xFF039BE5)),
(700, Color::from_argb_u32(0xFF0288D1)),
(800, Color::from_argb_u32(0xFF0277BD)),
(900, Color::from_argb_u32(0xFF01579B)),
];
#[rustfmt::skip]
const CYAN_SHADES: &[(u16, Color)] = &[
(50, Color::from_argb_u32(0xFFE0F7FA)),
(100, Color::from_argb_u32(0xFFB2EBF2)),
(200, Color::from_argb_u32(0xFF80DEEA)),
(300, Color::from_argb_u32(0xFF4DD0E1)),
(400, Color::from_argb_u32(0xFF26C6DA)),
(500, Color::from_argb_u32(0xFF00BCD4)),
(600, Color::from_argb_u32(0xFF00ACC1)),
(700, Color::from_argb_u32(0xFF0097A7)),
(800, Color::from_argb_u32(0xFF00838F)),
(900, Color::from_argb_u32(0xFF006064)),
];
#[rustfmt::skip]
const TEAL_SHADES: &[(u16, Color)] = &[
(50, Color::from_argb_u32(0xFFE0F2F1)),
(100, Color::from_argb_u32(0xFFB2DFDB)),
(200, Color::from_argb_u32(0xFF80CBC4)),
(300, Color::from_argb_u32(0xFF4DB6AC)),
(400, Color::from_argb_u32(0xFF26A69A)),
(500, Color::from_argb_u32(0xFF009688)),
(600, Color::from_argb_u32(0xFF00897B)),
(700, Color::from_argb_u32(0xFF00796B)),
(800, Color::from_argb_u32(0xFF00695C)),
(900, Color::from_argb_u32(0xFF004D40)),
];
#[rustfmt::skip]
const GREEN_SHADES: &[(u16, Color)] = &[
(50, Color::from_argb_u32(0xFFE8F5E9)),
(100, Color::from_argb_u32(0xFFC8E6C9)),
(200, Color::from_argb_u32(0xFFA5D6A7)),
(300, Color::from_argb_u32(0xFF81C784)),
(400, Color::from_argb_u32(0xFF66BB6A)),
(500, Color::from_argb_u32(0xFF4CAF50)),
(600, Color::from_argb_u32(0xFF43A047)),
(700, Color::from_argb_u32(0xFF388E3C)),
(800, Color::from_argb_u32(0xFF2E7D32)),
(900, Color::from_argb_u32(0xFF1B5E20)),
];
#[rustfmt::skip]
const LIGHT_GREEN_SHADES: &[(u16, Color)] = &[
(50, Color::from_argb_u32(0xFFF1F8E9)),
(100, Color::from_argb_u32(0xFFDCEDC8)),
(200, Color::from_argb_u32(0xFFC5E1A5)),
(300, Color::from_argb_u32(0xFFAED581)),
(400, Color::from_argb_u32(0xFF9CCC65)),
(500, Color::from_argb_u32(0xFF8BC34A)),
(600, Color::from_argb_u32(0xFF7CB342)),
(700, Color::from_argb_u32(0xFF689F38)),
(800, Color::from_argb_u32(0xFF558B2F)),
(900, Color::from_argb_u32(0xFF33691E)),
];
#[rustfmt::skip]
const LIME_SHADES: &[(u16, Color)] = &[
(50, Color::from_argb_u32(0xFFF9FBE7)),
(100, Color::from_argb_u32(0xFFF0F4C3)),
(200, Color::from_argb_u32(0xFFE6EE9C)),
(300, Color::from_argb_u32(0xFFDCE775)),
(400, Color::from_argb_u32(0xFFD4E157)),
(500, Color::from_argb_u32(0xFFCDDC39)),
(600, Color::from_argb_u32(0xFFC0CA33)),
(700, Color::from_argb_u32(0xFFAFB42B)),
(800, Color::from_argb_u32(0xFF9E9D24)),
(900, Color::from_argb_u32(0xFF827717)),
];
#[rustfmt::skip]
const YELLOW_SHADES: &[(u16, Color)] = &[
(50, Color::from_argb_u32(0xFFFFFDE7)),
(100, Color::from_argb_u32(0xFFFFF9C4)),
(200, Color::from_argb_u32(0xFFFFF59D)),
(300, Color::from_argb_u32(0xFFFFF176)),
(400, Color::from_argb_u32(0xFFFFEE58)),
(500, Color::from_argb_u32(0xFFFFEB3B)),
(600, Color::from_argb_u32(0xFFFDD835)),
(700, Color::from_argb_u32(0xFFFBC02D)),
(800, Color::from_argb_u32(0xFFF9A825)),
(900, Color::from_argb_u32(0xFFF57F17)),
];
#[rustfmt::skip]
const AMBER_SHADES: &[(u16, Color)] = &[
(50, Color::from_argb_u32(0xFFFFF8E1)),
(100, Color::from_argb_u32(0xFFFFECB3)),
(200, Color::from_argb_u32(0xFFFFE082)),
(300, Color::from_argb_u32(0xFFFFD54F)),
(400, Color::from_argb_u32(0xFFFFCA28)),
(500, Color::from_argb_u32(0xFFFFC107)),
(600, Color::from_argb_u32(0xFFFFB300)),
(700, Color::from_argb_u32(0xFFFFA000)),
(800, Color::from_argb_u32(0xFFFF8F00)),
(900, Color::from_argb_u32(0xFFFF6F00)),
];
#[rustfmt::skip]
const ORANGE_SHADES: &[(u16, Color)] = &[
(50, Color::from_argb_u32(0xFFFFF3E0)),
(100, Color::from_argb_u32(0xFFFFE0B2)),
(200, Color::from_argb_u32(0xFFFFCC80)),
(300, Color::from_argb_u32(0xFFFFB74D)),
(400, Color::from_argb_u32(0xFFFFA726)),
(500, Color::from_argb_u32(0xFFFF9800)),
(600, Color::from_argb_u32(0xFFFB8C00)),
(700, Color::from_argb_u32(0xFFF57C00)),
(800, Color::from_argb_u32(0xFFEF6C00)),
(900, Color::from_argb_u32(0xFFE65100)),
];
#[rustfmt::skip]
const DEEP_ORANGE_SHADES: &[(u16, Color)] = &[
(50, Color::from_argb_u32(0xFFFBE9E7)),
(100, Color::from_argb_u32(0xFFFFCCBC)),
(200, Color::from_argb_u32(0xFFFFAB91)),
(300, Color::from_argb_u32(0xFFFF8A65)),
(400, Color::from_argb_u32(0xFFFF7043)),
(500, Color::from_argb_u32(0xFFFF5722)),
(600, Color::from_argb_u32(0xFFF4511E)),
(700, Color::from_argb_u32(0xFFE64A19)),
(800, Color::from_argb_u32(0xFFD84315)),
(900, Color::from_argb_u32(0xFFBF360C)),
];
#[rustfmt::skip]
const BROWN_SHADES: &[(u16, Color)] = &[
(50, Color::from_argb_u32(0xFFEFEBE9)),
(100, Color::from_argb_u32(0xFFD7CCC8)),
(200, Color::from_argb_u32(0xFFBCAAA4)),
(300, Color::from_argb_u32(0xFFA1887F)),
(400, Color::from_argb_u32(0xFF8D6E63)),
(500, Color::from_argb_u32(0xFF795548)),
(600, Color::from_argb_u32(0xFF6D4C41)),
(700, Color::from_argb_u32(0xFF5D4037)),
(800, Color::from_argb_u32(0xFF4E342E)),
(900, Color::from_argb_u32(0xFF3E2723)),
];
#[rustfmt::skip]
const GREY_SHADES: &[(u16, Color)] = &[
(50, Color::from_argb_u32(0xFFFAFAFA)),
(100, Color::from_argb_u32(0xFFF5F5F5)),
(200, Color::from_argb_u32(0xFFEEEEEE)),
(300, Color::from_argb_u32(0xFFE0E0E0)),
(350, Color::from_argb_u32(0xFFD6D6D6)),
(400, Color::from_argb_u32(0xFFBDBDBD)),
(500, Color::from_argb_u32(0xFF9E9E9E)),
(600, Color::from_argb_u32(0xFF757575)),
(700, Color::from_argb_u32(0xFF616161)),
(800, Color::from_argb_u32(0xFF424242)),
(850, Color::from_argb_u32(0xFF303030)),
(900, Color::from_argb_u32(0xFF212121)),
];
#[rustfmt::skip]
const BLUE_GREY_SHADES: &[(u16, Color)] = &[
(50, Color::from_argb_u32(0xFFECEFF1)),
(100, Color::from_argb_u32(0xFFCFD8DC)),
(200, Color::from_argb_u32(0xFFB0BEC5)),
(300, Color::from_argb_u32(0xFF90A4AE)),
(400, Color::from_argb_u32(0xFF78909C)),
(500, Color::from_argb_u32(0xFF607D8B)),
(600, Color::from_argb_u32(0xFF546E7A)),
(700, Color::from_argb_u32(0xFF455A64)),
(800, Color::from_argb_u32(0xFF37474F)),
(900, Color::from_argb_u32(0xFF263238)),
];
#[rustfmt::skip]
const RED_ACCENT_SHADES: &[(u16, Color)] = &[
(100, Color::from_argb_u32(0xFFFF8A80)),
(200, Color::from_argb_u32(0xFFFF5252)),
(400, Color::from_argb_u32(0xFFFF1744)),
(700, Color::from_argb_u32(0xFFD50000)),
];
#[rustfmt::skip]
const PINK_ACCENT_SHADES: &[(u16, Color)] = &[
(100, Color::from_argb_u32(0xFFFF80AB)),
(200, Color::from_argb_u32(0xFFFF4081)),
(400, Color::from_argb_u32(0xFFF50057)),
(700, Color::from_argb_u32(0xFFC51162)),
];
#[rustfmt::skip]
const PURPLE_ACCENT_SHADES: &[(u16, Color)] = &[
(100, Color::from_argb_u32(0xFFEA80FC)),
(200, Color::from_argb_u32(0xFFE040FB)),
(400, Color::from_argb_u32(0xFFD500F9)),
(700, Color::from_argb_u32(0xFFAA00FF)),
];
#[rustfmt::skip]
const DEEP_PURPLE_ACCENT_SHADES: &[(u16, Color)] = &[
(100, Color::from_argb_u32(0xFFB388FF)),
(200, Color::from_argb_u32(0xFF7C4DFF)),
(400, Color::from_argb_u32(0xFF651FFF)),
(700, Color::from_argb_u32(0xFF6200EA)),
];
#[rustfmt::skip]
const INDIGO_ACCENT_SHADES: &[(u16, Color)] = &[
(100, Color::from_argb_u32(0xFF8C9EFF)),
(200, Color::from_argb_u32(0xFF536DFE)),
(400, Color::from_argb_u32(0xFF3D5AFE)),
(700, Color::from_argb_u32(0xFF304FFE)),
];
#[rustfmt::skip]
const BLUE_ACCENT_SHADES: &[(u16, Color)] = &[
(100, Color::from_argb_u32(0xFF82B1FF)),
(200, Color::from_argb_u32(0xFF448AFF)),
(400, Color::from_argb_u32(0xFF2979FF)),
(700, Color::from_argb_u32(0xFF2962FF)),
];
#[rustfmt::skip]
const LIGHT_BLUE_ACCENT_SHADES: &[(u16, Color)] = &[
(100, Color::from_argb_u32(0xFF80D8FF)),
(200, Color::from_argb_u32(0xFF40C4FF)),
(400, Color::from_argb_u32(0xFF00B0FF)),
(700, Color::from_argb_u32(0xFF0091EA)),
];
#[rustfmt::skip]
const CYAN_ACCENT_SHADES: &[(u16, Color)] = &[
(100, Color::from_argb_u32(0xFF84FFFF)),
(200, Color::from_argb_u32(0xFF18FFFF)),
(400, Color::from_argb_u32(0xFF00E5FF)),
(700, Color::from_argb_u32(0xFF00B8D4)),
];
#[rustfmt::skip]
const TEAL_ACCENT_SHADES: &[(u16, Color)] = &[
(100, Color::from_argb_u32(0xFFA7FFEB)),
(200, Color::from_argb_u32(0xFF64FFDA)),
(400, Color::from_argb_u32(0xFF1DE9B6)),
(700, Color::from_argb_u32(0xFF00BFA5)),
];
#[rustfmt::skip]
const GREEN_ACCENT_SHADES: &[(u16, Color)] = &[
(100, Color::from_argb_u32(0xFFB9F6CA)),
(200, Color::from_argb_u32(0xFF69F0AE)),
(400, Color::from_argb_u32(0xFF00E676)),
(700, Color::from_argb_u32(0xFF00C853)),
];
#[rustfmt::skip]
const LIGHT_GREEN_ACCENT_SHADES: &[(u16, Color)] = &[
(100, Color::from_argb_u32(0xFFCCFF90)),
(200, Color::from_argb_u32(0xFFB2FF59)),
(400, Color::from_argb_u32(0xFF76FF03)),
(700, Color::from_argb_u32(0xFF64DD17)),
];
#[rustfmt::skip]
const LIME_ACCENT_SHADES: &[(u16, Color)] = &[
(100, Color::from_argb_u32(0xFFF4FF81)),
(200, Color::from_argb_u32(0xFFEEFF41)),
(400, Color::from_argb_u32(0xFFC6FF00)),
(700, Color::from_argb_u32(0xFFAEEA00)),
];
#[rustfmt::skip]
const YELLOW_ACCENT_SHADES: &[(u16, Color)] = &[
(100, Color::from_argb_u32(0xFFFFFF8D)),
(200, Color::from_argb_u32(0xFFFFFF00)),
(400, Color::from_argb_u32(0xFFFFEA00)),
(700, Color::from_argb_u32(0xFFFFD600)),
];
#[rustfmt::skip]
const AMBER_ACCENT_SHADES: &[(u16, Color)] = &[
(100, Color::from_argb_u32(0xFFFFE57F)),
(200, Color::from_argb_u32(0xFFFFD740)),
(400, Color::from_argb_u32(0xFFFFC400)),
(700, Color::from_argb_u32(0xFFFFAB00)),
];
#[rustfmt::skip]
const ORANGE_ACCENT_SHADES: &[(u16, Color)] = &[
(100, Color::from_argb_u32(0xFFFFD180)),
(200, Color::from_argb_u32(0xFFFFAB40)),
(400, Color::from_argb_u32(0xFFFF9100)),
(700, Color::from_argb_u32(0xFFFF6D00)),
];
#[rustfmt::skip]
const DEEP_ORANGE_ACCENT_SHADES: &[(u16, Color)] = &[
(100, Color::from_argb_u32(0xFFFF9E80)),
(200, Color::from_argb_u32(0xFFFF6E40)),
(400, Color::from_argb_u32(0xFFFF3D00)),
(700, Color::from_argb_u32(0xFFDD2C00)),
];
impl MaterialColor {
pub const RED: MaterialColor = MaterialColor::new(Color::from_argb_u32(0xFFF44336), RED_SHADES);
pub const PINK: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFFE91E63), PINK_SHADES);
pub const PURPLE: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFF9C27B0), PURPLE_SHADES);
pub const DEEP_PURPLE: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFF673AB7), DEEP_PURPLE_SHADES);
pub const INDIGO: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFF3F51B5), INDIGO_SHADES);
pub const BLUE: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFF2196F3), BLUE_SHADES);
pub const LIGHT_BLUE: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFF03A9F4), LIGHT_BLUE_SHADES);
pub const CYAN: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFF00BCD4), CYAN_SHADES);
pub const TEAL: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFF009688), TEAL_SHADES);
pub const GREEN: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFF4CAF50), GREEN_SHADES);
pub const LIGHT_GREEN: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFF8BC34A), LIGHT_GREEN_SHADES);
pub const LIME: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFFCDDC39), LIME_SHADES);
pub const YELLOW: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFFFFEB3B), YELLOW_SHADES);
pub const AMBER: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFFFFC107), AMBER_SHADES);
pub const ORANGE: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFFFF9800), ORANGE_SHADES);
pub const DEEP_ORANGE: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFFFF5722), DEEP_ORANGE_SHADES);
pub const BROWN: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFF795548), BROWN_SHADES);
pub const GREY: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFF9E9E9E), GREY_SHADES);
pub const BLUE_GREY: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFF607D8B), BLUE_GREY_SHADES);
pub const RED_ACCENT: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFFFF5252), RED_ACCENT_SHADES);
pub const PINK_ACCENT: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFFFF4081), PINK_ACCENT_SHADES);
pub const PURPLE_ACCENT: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFFE040FB), PURPLE_ACCENT_SHADES);
pub const DEEP_PURPLE_ACCENT: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFF7C4DFF), DEEP_PURPLE_ACCENT_SHADES);
pub const INDIGO_ACCENT: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFF536DFE), INDIGO_ACCENT_SHADES);
pub const BLUE_ACCENT: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFF448AFF), BLUE_ACCENT_SHADES);
pub const LIGHT_BLUE_ACCENT: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFF40C4FF), LIGHT_BLUE_ACCENT_SHADES);
pub const CYAN_ACCENT: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFF18FFFF), CYAN_ACCENT_SHADES);
pub const TEAL_ACCENT: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFF64FFDA), TEAL_ACCENT_SHADES);
pub const GREEN_ACCENT: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFF69F0AE), GREEN_ACCENT_SHADES);
pub const LIGHT_GREEN_ACCENT: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFFB2FF59), LIGHT_GREEN_ACCENT_SHADES);
pub const LIME_ACCENT: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFFEEFF41), LIME_ACCENT_SHADES);
pub const YELLOW_ACCENT: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFFFFFF00), YELLOW_ACCENT_SHADES);
pub const AMBER_ACCENT: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFFFFD740), AMBER_ACCENT_SHADES);
pub const ORANGE_ACCENT: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFFFFAB40), ORANGE_ACCENT_SHADES);
pub const DEEP_ORANGE_ACCENT: MaterialColor =
MaterialColor::new(Color::from_argb_u32(0xFFFF6E40), DEEP_ORANGE_ACCENT_SHADES);
}
#[derive(Clone, Copy, Debug)]
pub struct Colors;
impl Colors {
pub const TRANSPARENT: Color = Color::from_argb_u32(0x00000000);
pub const BLACK: Color = Color::from_argb_u32(0xFF000000);
pub const BLACK87: Color = Color::from_argb_u32(0xDD000000);
pub const BLACK54: Color = Color::from_argb_u32(0x8A000000);
pub const BLACK45: Color = Color::from_argb_u32(0x73000000);
pub const BLACK38: Color = Color::from_argb_u32(0x61000000);
pub const BLACK26: Color = Color::from_argb_u32(0x42000000);
pub const BLACK12: Color = Color::from_argb_u32(0x1F000000);
pub const WHITE: Color = Color::from_argb_u32(0xFFFFFFFF);
pub const WHITE70: Color = Color::from_argb_u32(0xB3FFFFFF);
pub const WHITE60: Color = Color::from_argb_u32(0x99FFFFFF);
pub const WHITE54: Color = Color::from_argb_u32(0x8AFFFFFF);
pub const WHITE38: Color = Color::from_argb_u32(0x62FFFFFF);
pub const WHITE30: Color = Color::from_argb_u32(0x4DFFFFFF);
pub const WHITE24: Color = Color::from_argb_u32(0x3DFFFFFF);
pub const WHITE12: Color = Color::from_argb_u32(0x1FFFFFFF);
pub const WHITE10: Color = Color::from_argb_u32(0x1AFFFFFF);
pub const RED: Color = Color::from_argb_u32(0xFFF44336);
pub const RED_50: Color = Color::from_argb_u32(0xFFFFEBEE);
pub const RED_100: Color = Color::from_argb_u32(0xFFFFCDD2);
pub const RED_200: Color = Color::from_argb_u32(0xFFEF9A9A);
pub const RED_300: Color = Color::from_argb_u32(0xFFE57373);
pub const RED_400: Color = Color::from_argb_u32(0xFFEF5350);
pub const RED_500: Color = Color::from_argb_u32(0xFFF44336);
pub const RED_600: Color = Color::from_argb_u32(0xFFE53935);
pub const RED_700: Color = Color::from_argb_u32(0xFFD32F2F);
pub const RED_800: Color = Color::from_argb_u32(0xFFC62828);
pub const RED_900: Color = Color::from_argb_u32(0xFFB71C1C);
pub const PINK: Color = Color::from_argb_u32(0xFFE91E63);
pub const PINK_50: Color = Color::from_argb_u32(0xFFFCE4EC);
pub const PINK_100: Color = Color::from_argb_u32(0xFFF8BBD0);
pub const PINK_200: Color = Color::from_argb_u32(0xFFF48FB1);
pub const PINK_300: Color = Color::from_argb_u32(0xFFF06292);
pub const PINK_400: Color = Color::from_argb_u32(0xFFEC407A);
pub const PINK_500: Color = Color::from_argb_u32(0xFFE91E63);
pub const PINK_600: Color = Color::from_argb_u32(0xFFD81B60);
pub const PINK_700: Color = Color::from_argb_u32(0xFFC2185B);
pub const PINK_800: Color = Color::from_argb_u32(0xFFAD1457);
pub const PINK_900: Color = Color::from_argb_u32(0xFF880E4F);
pub const PURPLE: Color = Color::from_argb_u32(0xFF9C27B0);
pub const PURPLE_50: Color = Color::from_argb_u32(0xFFF3E5F5);
pub const PURPLE_100: Color = Color::from_argb_u32(0xFFE1BEE7);
pub const PURPLE_200: Color = Color::from_argb_u32(0xFFCE93D8);
pub const PURPLE_300: Color = Color::from_argb_u32(0xFFBA68C8);
pub const PURPLE_400: Color = Color::from_argb_u32(0xFFAB47BC);
pub const PURPLE_500: Color = Color::from_argb_u32(0xFF9C27B0);
pub const PURPLE_600: Color = Color::from_argb_u32(0xFF8E24AA);
pub const PURPLE_700: Color = Color::from_argb_u32(0xFF7B1FA2);
pub const PURPLE_800: Color = Color::from_argb_u32(0xFF6A1B9A);
pub const PURPLE_900: Color = Color::from_argb_u32(0xFF4A148C);
pub const DEEP_PURPLE: Color = Color::from_argb_u32(0xFF673AB7);
pub const DEEP_PURPLE_50: Color = Color::from_argb_u32(0xFFEDE7F6);
pub const DEEP_PURPLE_100: Color = Color::from_argb_u32(0xFFD1C4E9);
pub const DEEP_PURPLE_200: Color = Color::from_argb_u32(0xFFB39DDB);
pub const DEEP_PURPLE_300: Color = Color::from_argb_u32(0xFF9575CD);
pub const DEEP_PURPLE_400: Color = Color::from_argb_u32(0xFF7E57C2);
pub const DEEP_PURPLE_500: Color = Color::from_argb_u32(0xFF673AB7);
pub const DEEP_PURPLE_600: Color = Color::from_argb_u32(0xFF5E35B1);
pub const DEEP_PURPLE_700: Color = Color::from_argb_u32(0xFF512DA8);
pub const DEEP_PURPLE_800: Color = Color::from_argb_u32(0xFF4527A0);
pub const DEEP_PURPLE_900: Color = Color::from_argb_u32(0xFF311B92);
pub const INDIGO: Color = Color::from_argb_u32(0xFF3F51B5);
pub const INDIGO_50: Color = Color::from_argb_u32(0xFFE8EAF6);
pub const INDIGO_100: Color = Color::from_argb_u32(0xFFC5CAE9);
pub const INDIGO_200: Color = Color::from_argb_u32(0xFF9FA8DA);
pub const INDIGO_300: Color = Color::from_argb_u32(0xFF7986CB);
pub const INDIGO_400: Color = Color::from_argb_u32(0xFF5C6BC0);
pub const INDIGO_500: Color = Color::from_argb_u32(0xFF3F51B5);
pub const INDIGO_600: Color = Color::from_argb_u32(0xFF3949AB);
pub const INDIGO_700: Color = Color::from_argb_u32(0xFF303F9F);
pub const INDIGO_800: Color = Color::from_argb_u32(0xFF283593);
pub const INDIGO_900: Color = Color::from_argb_u32(0xFF1A237E);
pub const BLUE: Color = Color::from_argb_u32(0xFF2196F3);
pub const BLUE_50: Color = Color::from_argb_u32(0xFFE3F2FD);
pub const BLUE_100: Color = Color::from_argb_u32(0xFFBBDEFB);
pub const BLUE_200: Color = Color::from_argb_u32(0xFF90CAF9);
pub const BLUE_300: Color = Color::from_argb_u32(0xFF64B5F6);
pub const BLUE_400: Color = Color::from_argb_u32(0xFF42A5F5);
pub const BLUE_500: Color = Color::from_argb_u32(0xFF2196F3);
pub const BLUE_600: Color = Color::from_argb_u32(0xFF1E88E5);
pub const BLUE_700: Color = Color::from_argb_u32(0xFF1976D2);
pub const BLUE_800: Color = Color::from_argb_u32(0xFF1565C0);
pub const BLUE_900: Color = Color::from_argb_u32(0xFF0D47A1);
pub const LIGHT_BLUE: Color = Color::from_argb_u32(0xFF03A9F4);
pub const LIGHT_BLUE_50: Color = Color::from_argb_u32(0xFFE1F5FE);
pub const LIGHT_BLUE_100: Color = Color::from_argb_u32(0xFFB3E5FC);
pub const LIGHT_BLUE_200: Color = Color::from_argb_u32(0xFF81D4FA);
pub const LIGHT_BLUE_300: Color = Color::from_argb_u32(0xFF4FC3F7);
pub const LIGHT_BLUE_400: Color = Color::from_argb_u32(0xFF29B6F6);
pub const LIGHT_BLUE_500: Color = Color::from_argb_u32(0xFF03A9F4);
pub const LIGHT_BLUE_600: Color = Color::from_argb_u32(0xFF039BE5);
pub const LIGHT_BLUE_700: Color = Color::from_argb_u32(0xFF0288D1);
pub const LIGHT_BLUE_800: Color = Color::from_argb_u32(0xFF0277BD);
pub const LIGHT_BLUE_900: Color = Color::from_argb_u32(0xFF01579B);
pub const CYAN: Color = Color::from_argb_u32(0xFF00BCD4);
pub const CYAN_50: Color = Color::from_argb_u32(0xFFE0F7FA);
pub const CYAN_100: Color = Color::from_argb_u32(0xFFB2EBF2);
pub const CYAN_200: Color = Color::from_argb_u32(0xFF80DEEA);
pub const CYAN_300: Color = Color::from_argb_u32(0xFF4DD0E1);
pub const CYAN_400: Color = Color::from_argb_u32(0xFF26C6DA);
pub const CYAN_500: Color = Color::from_argb_u32(0xFF00BCD4);
pub const CYAN_600: Color = Color::from_argb_u32(0xFF00ACC1);
pub const CYAN_700: Color = Color::from_argb_u32(0xFF0097A7);
pub const CYAN_800: Color = Color::from_argb_u32(0xFF00838F);
pub const CYAN_900: Color = Color::from_argb_u32(0xFF006064);
pub const TEAL: Color = Color::from_argb_u32(0xFF009688);
pub const TEAL_50: Color = Color::from_argb_u32(0xFFE0F2F1);
pub const TEAL_100: Color = Color::from_argb_u32(0xFFB2DFDB);
pub const TEAL_200: Color = Color::from_argb_u32(0xFF80CBC4);
pub const TEAL_300: Color = Color::from_argb_u32(0xFF4DB6AC);
pub const TEAL_400: Color = Color::from_argb_u32(0xFF26A69A);
pub const TEAL_500: Color = Color::from_argb_u32(0xFF009688);
pub const TEAL_600: Color = Color::from_argb_u32(0xFF00897B);
pub const TEAL_700: Color = Color::from_argb_u32(0xFF00796B);
pub const TEAL_800: Color = Color::from_argb_u32(0xFF00695C);
pub const TEAL_900: Color = Color::from_argb_u32(0xFF004D40);
pub const GREEN: Color = Color::from_argb_u32(0xFF4CAF50);
pub const GREEN_50: Color = Color::from_argb_u32(0xFFE8F5E9);
pub const GREEN_100: Color = Color::from_argb_u32(0xFFC8E6C9);
pub const GREEN_200: Color = Color::from_argb_u32(0xFFA5D6A7);
pub const GREEN_300: Color = Color::from_argb_u32(0xFF81C784);
pub const GREEN_400: Color = Color::from_argb_u32(0xFF66BB6A);
pub const GREEN_500: Color = Color::from_argb_u32(0xFF4CAF50);
pub const GREEN_600: Color = Color::from_argb_u32(0xFF43A047);
pub const GREEN_700: Color = Color::from_argb_u32(0xFF388E3C);
pub const GREEN_800: Color = Color::from_argb_u32(0xFF2E7D32);
pub const GREEN_900: Color = Color::from_argb_u32(0xFF1B5E20);
pub const LIGHT_GREEN: Color = Color::from_argb_u32(0xFF8BC34A);
pub const LIGHT_GREEN_50: Color = Color::from_argb_u32(0xFFF1F8E9);
pub const LIGHT_GREEN_100: Color = Color::from_argb_u32(0xFFDCEDC8);
pub const LIGHT_GREEN_200: Color = Color::from_argb_u32(0xFFC5E1A5);
pub const LIGHT_GREEN_300: Color = Color::from_argb_u32(0xFFAED581);
pub const LIGHT_GREEN_400: Color = Color::from_argb_u32(0xFF9CCC65);
pub const LIGHT_GREEN_500: Color = Color::from_argb_u32(0xFF8BC34A);
pub const LIGHT_GREEN_600: Color = Color::from_argb_u32(0xFF7CB342);
pub const LIGHT_GREEN_700: Color = Color::from_argb_u32(0xFF689F38);
pub const LIGHT_GREEN_800: Color = Color::from_argb_u32(0xFF558B2F);
pub const LIGHT_GREEN_900: Color = Color::from_argb_u32(0xFF33691E);
pub const LIME: Color = Color::from_argb_u32(0xFFCDDC39);
pub const LIME_50: Color = Color::from_argb_u32(0xFFF9FBE7);
pub const LIME_100: Color = Color::from_argb_u32(0xFFF0F4C3);
pub const LIME_200: Color = Color::from_argb_u32(0xFFE6EE9C);
pub const LIME_300: Color = Color::from_argb_u32(0xFFDCE775);
pub const LIME_400: Color = Color::from_argb_u32(0xFFD4E157);
pub const LIME_500: Color = Color::from_argb_u32(0xFFCDDC39);
pub const LIME_600: Color = Color::from_argb_u32(0xFFC0CA33);
pub const LIME_700: Color = Color::from_argb_u32(0xFFAFB42B);
pub const LIME_800: Color = Color::from_argb_u32(0xFF9E9D24);
pub const LIME_900: Color = Color::from_argb_u32(0xFF827717);
pub const YELLOW: Color = Color::from_argb_u32(0xFFFFEB3B);
pub const YELLOW_50: Color = Color::from_argb_u32(0xFFFFFDE7);
pub const YELLOW_100: Color = Color::from_argb_u32(0xFFFFF9C4);
pub const YELLOW_200: Color = Color::from_argb_u32(0xFFFFF59D);
pub const YELLOW_300: Color = Color::from_argb_u32(0xFFFFF176);
pub const YELLOW_400: Color = Color::from_argb_u32(0xFFFFEE58);
pub const YELLOW_500: Color = Color::from_argb_u32(0xFFFFEB3B);
pub const YELLOW_600: Color = Color::from_argb_u32(0xFFFDD835);
pub const YELLOW_700: Color = Color::from_argb_u32(0xFFFBC02D);
pub const YELLOW_800: Color = Color::from_argb_u32(0xFFF9A825);
pub const YELLOW_900: Color = Color::from_argb_u32(0xFFF57F17);
pub const AMBER: Color = Color::from_argb_u32(0xFFFFC107);
pub const AMBER_50: Color = Color::from_argb_u32(0xFFFFF8E1);
pub const AMBER_100: Color = Color::from_argb_u32(0xFFFFECB3);
pub const AMBER_200: Color = Color::from_argb_u32(0xFFFFE082);
pub const AMBER_300: Color = Color::from_argb_u32(0xFFFFD54F);
pub const AMBER_400: Color = Color::from_argb_u32(0xFFFFCA28);
pub const AMBER_500: Color = Color::from_argb_u32(0xFFFFC107);
pub const AMBER_600: Color = Color::from_argb_u32(0xFFFFB300);
pub const AMBER_700: Color = Color::from_argb_u32(0xFFFFA000);
pub const AMBER_800: Color = Color::from_argb_u32(0xFFFF8F00);
pub const AMBER_900: Color = Color::from_argb_u32(0xFFFF6F00);
pub const ORANGE: Color = Color::from_argb_u32(0xFFFF9800);
pub const ORANGE_50: Color = Color::from_argb_u32(0xFFFFF3E0);
pub const ORANGE_100: Color = Color::from_argb_u32(0xFFFFE0B2);
pub const ORANGE_200: Color = Color::from_argb_u32(0xFFFFCC80);
pub const ORANGE_300: Color = Color::from_argb_u32(0xFFFFB74D);
pub const ORANGE_400: Color = Color::from_argb_u32(0xFFFFA726);
pub const ORANGE_500: Color = Color::from_argb_u32(0xFFFF9800);
pub const ORANGE_600: Color = Color::from_argb_u32(0xFFFB8C00);
pub const ORANGE_700: Color = Color::from_argb_u32(0xFFF57C00);
pub const ORANGE_800: Color = Color::from_argb_u32(0xFFEF6C00);
pub const ORANGE_900: Color = Color::from_argb_u32(0xFFE65100);
pub const DEEP_ORANGE: Color = Color::from_argb_u32(0xFFFF5722);
pub const DEEP_ORANGE_50: Color = Color::from_argb_u32(0xFFFBE9E7);
pub const DEEP_ORANGE_100: Color = Color::from_argb_u32(0xFFFFCCBC);
pub const DEEP_ORANGE_200: Color = Color::from_argb_u32(0xFFFFAB91);
pub const DEEP_ORANGE_300: Color = Color::from_argb_u32(0xFFFF8A65);
pub const DEEP_ORANGE_400: Color = Color::from_argb_u32(0xFFFF7043);
pub const DEEP_ORANGE_500: Color = Color::from_argb_u32(0xFFFF5722);
pub const DEEP_ORANGE_600: Color = Color::from_argb_u32(0xFFF4511E);
pub const DEEP_ORANGE_700: Color = Color::from_argb_u32(0xFFE64A19);
pub const DEEP_ORANGE_800: Color = Color::from_argb_u32(0xFFD84315);
pub const DEEP_ORANGE_900: Color = Color::from_argb_u32(0xFFBF360C);
pub const BROWN: Color = Color::from_argb_u32(0xFF795548);
pub const BROWN_50: Color = Color::from_argb_u32(0xFFEFEBE9);
pub const BROWN_100: Color = Color::from_argb_u32(0xFFD7CCC8);
pub const BROWN_200: Color = Color::from_argb_u32(0xFFBCAAA4);
pub const BROWN_300: Color = Color::from_argb_u32(0xFFA1887F);
pub const BROWN_400: Color = Color::from_argb_u32(0xFF8D6E63);
pub const BROWN_500: Color = Color::from_argb_u32(0xFF795548);
pub const BROWN_600: Color = Color::from_argb_u32(0xFF6D4C41);
pub const BROWN_700: Color = Color::from_argb_u32(0xFF5D4037);
pub const BROWN_800: Color = Color::from_argb_u32(0xFF4E342E);
pub const BROWN_900: Color = Color::from_argb_u32(0xFF3E2723);
pub const GREY: Color = Color::from_argb_u32(0xFF9E9E9E);
pub const GREY_50: Color = Color::from_argb_u32(0xFFFAFAFA);
pub const GREY_100: Color = Color::from_argb_u32(0xFFF5F5F5);
pub const GREY_200: Color = Color::from_argb_u32(0xFFEEEEEE);
pub const GREY_300: Color = Color::from_argb_u32(0xFFE0E0E0);
pub const GREY_350: Color = Color::from_argb_u32(0xFFD6D6D6);
pub const GREY_400: Color = Color::from_argb_u32(0xFFBDBDBD);
pub const GREY_500: Color = Color::from_argb_u32(0xFF9E9E9E);
pub const GREY_600: Color = Color::from_argb_u32(0xFF757575);
pub const GREY_700: Color = Color::from_argb_u32(0xFF616161);
pub const GREY_800: Color = Color::from_argb_u32(0xFF424242);
pub const GREY_850: Color = Color::from_argb_u32(0xFF303030);
pub const GREY_900: Color = Color::from_argb_u32(0xFF212121);
pub const BLUE_GREY: Color = Color::from_argb_u32(0xFF607D8B);
pub const BLUE_GREY_50: Color = Color::from_argb_u32(0xFFECEFF1);
pub const BLUE_GREY_100: Color = Color::from_argb_u32(0xFFCFD8DC);
pub const BLUE_GREY_200: Color = Color::from_argb_u32(0xFFB0BEC5);
pub const BLUE_GREY_300: Color = Color::from_argb_u32(0xFF90A4AE);
pub const BLUE_GREY_400: Color = Color::from_argb_u32(0xFF78909C);
pub const BLUE_GREY_500: Color = Color::from_argb_u32(0xFF607D8B);
pub const BLUE_GREY_600: Color = Color::from_argb_u32(0xFF546E7A);
pub const BLUE_GREY_700: Color = Color::from_argb_u32(0xFF455A64);
pub const BLUE_GREY_800: Color = Color::from_argb_u32(0xFF37474F);
pub const BLUE_GREY_900: Color = Color::from_argb_u32(0xFF263238);
pub const RED_ACCENT: Color = Color::from_argb_u32(0xFFFF5252);
pub const RED_ACCENT_100: Color = Color::from_argb_u32(0xFFFF8A80);
pub const RED_ACCENT_200: Color = Color::from_argb_u32(0xFFFF5252);
pub const RED_ACCENT_400: Color = Color::from_argb_u32(0xFFFF1744);
pub const RED_ACCENT_700: Color = Color::from_argb_u32(0xFFD50000);
pub const PINK_ACCENT: Color = Color::from_argb_u32(0xFFFF4081);
pub const PINK_ACCENT_100: Color = Color::from_argb_u32(0xFFFF80AB);
pub const PINK_ACCENT_200: Color = Color::from_argb_u32(0xFFFF4081);
pub const PINK_ACCENT_400: Color = Color::from_argb_u32(0xFFF50057);
pub const PINK_ACCENT_700: Color = Color::from_argb_u32(0xFFC51162);
pub const PURPLE_ACCENT: Color = Color::from_argb_u32(0xFFE040FB);
pub const PURPLE_ACCENT_100: Color = Color::from_argb_u32(0xFFEA80FC);
pub const PURPLE_ACCENT_200: Color = Color::from_argb_u32(0xFFE040FB);
pub const PURPLE_ACCENT_400: Color = Color::from_argb_u32(0xFFD500F9);
pub const PURPLE_ACCENT_700: Color = Color::from_argb_u32(0xFFAA00FF);
pub const DEEP_PURPLE_ACCENT: Color = Color::from_argb_u32(0xFF7C4DFF);
pub const DEEP_PURPLE_ACCENT_100: Color = Color::from_argb_u32(0xFFB388FF);
pub const DEEP_PURPLE_ACCENT_200: Color = Color::from_argb_u32(0xFF7C4DFF);
pub const DEEP_PURPLE_ACCENT_400: Color = Color::from_argb_u32(0xFF651FFF);
pub const DEEP_PURPLE_ACCENT_700: Color = Color::from_argb_u32(0xFF6200EA);
pub const INDIGO_ACCENT: Color = Color::from_argb_u32(0xFF536DFE);
pub const INDIGO_ACCENT_100: Color = Color::from_argb_u32(0xFF8C9EFF);
pub const INDIGO_ACCENT_200: Color = Color::from_argb_u32(0xFF536DFE);
pub const INDIGO_ACCENT_400: Color = Color::from_argb_u32(0xFF3D5AFE);
pub const INDIGO_ACCENT_700: Color = Color::from_argb_u32(0xFF304FFE);
pub const BLUE_ACCENT: Color = Color::from_argb_u32(0xFF448AFF);
pub const BLUE_ACCENT_100: Color = Color::from_argb_u32(0xFF82B1FF);
pub const BLUE_ACCENT_200: Color = Color::from_argb_u32(0xFF448AFF);
pub const BLUE_ACCENT_400: Color = Color::from_argb_u32(0xFF2979FF);
pub const BLUE_ACCENT_700: Color = Color::from_argb_u32(0xFF2962FF);
pub const LIGHT_BLUE_ACCENT: Color = Color::from_argb_u32(0xFF40C4FF);
pub const LIGHT_BLUE_ACCENT_100: Color = Color::from_argb_u32(0xFF80D8FF);
pub const LIGHT_BLUE_ACCENT_200: Color = Color::from_argb_u32(0xFF40C4FF);
pub const LIGHT_BLUE_ACCENT_400: Color = Color::from_argb_u32(0xFF00B0FF);
pub const LIGHT_BLUE_ACCENT_700: Color = Color::from_argb_u32(0xFF0091EA);
pub const CYAN_ACCENT: Color = Color::from_argb_u32(0xFF18FFFF);
pub const CYAN_ACCENT_100: Color = Color::from_argb_u32(0xFF84FFFF);
pub const CYAN_ACCENT_200: Color = Color::from_argb_u32(0xFF18FFFF);
pub const CYAN_ACCENT_400: Color = Color::from_argb_u32(0xFF00E5FF);
pub const CYAN_ACCENT_700: Color = Color::from_argb_u32(0xFF00B8D4);
pub const TEAL_ACCENT: Color = Color::from_argb_u32(0xFF64FFDA);
pub const TEAL_ACCENT_100: Color = Color::from_argb_u32(0xFFA7FFEB);
pub const TEAL_ACCENT_200: Color = Color::from_argb_u32(0xFF64FFDA);
pub const TEAL_ACCENT_400: Color = Color::from_argb_u32(0xFF1DE9B6);
pub const TEAL_ACCENT_700: Color = Color::from_argb_u32(0xFF00BFA5);
pub const GREEN_ACCENT: Color = Color::from_argb_u32(0xFF69F0AE);
pub const GREEN_ACCENT_100: Color = Color::from_argb_u32(0xFFB9F6CA);
pub const GREEN_ACCENT_200: Color = Color::from_argb_u32(0xFF69F0AE);
pub const GREEN_ACCENT_400: Color = Color::from_argb_u32(0xFF00E676);
pub const GREEN_ACCENT_700: Color = Color::from_argb_u32(0xFF00C853);
pub const LIGHT_GREEN_ACCENT: Color = Color::from_argb_u32(0xFFB2FF59);
pub const LIGHT_GREEN_ACCENT_100: Color = Color::from_argb_u32(0xFFCCFF90);
pub const LIGHT_GREEN_ACCENT_200: Color = Color::from_argb_u32(0xFFB2FF59);
pub const LIGHT_GREEN_ACCENT_400: Color = Color::from_argb_u32(0xFF76FF03);
pub const LIGHT_GREEN_ACCENT_700: Color = Color::from_argb_u32(0xFF64DD17);
pub const LIME_ACCENT: Color = Color::from_argb_u32(0xFFEEFF41);
pub const LIME_ACCENT_100: Color = Color::from_argb_u32(0xFFF4FF81);
pub const LIME_ACCENT_200: Color = Color::from_argb_u32(0xFFEEFF41);
pub const LIME_ACCENT_400: Color = Color::from_argb_u32(0xFFC6FF00);
pub const LIME_ACCENT_700: Color = Color::from_argb_u32(0xFFAEEA00);
pub const YELLOW_ACCENT: Color = Color::from_argb_u32(0xFFFFFF00);
pub const YELLOW_ACCENT_100: Color = Color::from_argb_u32(0xFFFFFF8D);
pub const YELLOW_ACCENT_200: Color = Color::from_argb_u32(0xFFFFFF00);
pub const YELLOW_ACCENT_400: Color = Color::from_argb_u32(0xFFFFEA00);
pub const YELLOW_ACCENT_700: Color = Color::from_argb_u32(0xFFFFD600);
pub const AMBER_ACCENT: Color = Color::from_argb_u32(0xFFFFD740);
pub const AMBER_ACCENT_100: Color = Color::from_argb_u32(0xFFFFE57F);
pub const AMBER_ACCENT_200: Color = Color::from_argb_u32(0xFFFFD740);
pub const AMBER_ACCENT_400: Color = Color::from_argb_u32(0xFFFFC400);
pub const AMBER_ACCENT_700: Color = Color::from_argb_u32(0xFFFFAB00);
pub const ORANGE_ACCENT: Color = Color::from_argb_u32(0xFFFFAB40);
pub const ORANGE_ACCENT_100: Color = Color::from_argb_u32(0xFFFFD180);
pub const ORANGE_ACCENT_200: Color = Color::from_argb_u32(0xFFFFAB40);
pub const ORANGE_ACCENT_400: Color = Color::from_argb_u32(0xFFFF9100);
pub const ORANGE_ACCENT_700: Color = Color::from_argb_u32(0xFFFF6D00);
pub const DEEP_ORANGE_ACCENT: Color = Color::from_argb_u32(0xFFFF6E40);
pub const DEEP_ORANGE_ACCENT_100: Color = Color::from_argb_u32(0xFFFF9E80);
pub const DEEP_ORANGE_ACCENT_200: Color = Color::from_argb_u32(0xFFFF6E40);
pub const DEEP_ORANGE_ACCENT_400: Color = Color::from_argb_u32(0xFFFF3D00);
pub const DEEP_ORANGE_ACCENT_700: Color = Color::from_argb_u32(0xFFDD2C00);
pub const PRIMARIES: [MaterialColor; 19] = [
MaterialColor::RED,
MaterialColor::PINK,
MaterialColor::PURPLE,
MaterialColor::DEEP_PURPLE,
MaterialColor::INDIGO,
MaterialColor::BLUE,
MaterialColor::LIGHT_BLUE,
MaterialColor::CYAN,
MaterialColor::TEAL,
MaterialColor::GREEN,
MaterialColor::LIGHT_GREEN,
MaterialColor::LIME,
MaterialColor::YELLOW,
MaterialColor::AMBER,
MaterialColor::ORANGE,
MaterialColor::DEEP_ORANGE,
MaterialColor::BROWN,
MaterialColor::GREY,
MaterialColor::BLUE_GREY,
];
pub const ACCENTS: [MaterialColor; 16] = [
MaterialColor::RED_ACCENT,
MaterialColor::PINK_ACCENT,
MaterialColor::PURPLE_ACCENT,
MaterialColor::DEEP_PURPLE_ACCENT,
MaterialColor::INDIGO_ACCENT,
MaterialColor::BLUE_ACCENT,
MaterialColor::LIGHT_BLUE_ACCENT,
MaterialColor::CYAN_ACCENT,
MaterialColor::TEAL_ACCENT,
MaterialColor::GREEN_ACCENT,
MaterialColor::LIGHT_GREEN_ACCENT,
MaterialColor::LIME_ACCENT,
MaterialColor::YELLOW_ACCENT,
MaterialColor::AMBER_ACCENT,
MaterialColor::ORANGE_ACCENT,
MaterialColor::DEEP_ORANGE_ACCENT,
];
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn every_primary_is_a_step_of_its_own_ramp() {
for ramp in Colors::PRIMARIES {
assert_eq!(ramp.shade(500), Some(ramp.primary()));
}
for ramp in Colors::ACCENTS {
assert_eq!(ramp.shade(200), Some(ramp.primary()));
}
}
#[test]
fn the_bare_name_is_the_primary_step() {
assert_eq!(Colors::RED, Colors::RED_500);
assert_eq!(Colors::BLUE, Colors::BLUE_500);
assert_eq!(Colors::GREY, Colors::GREY_500);
assert_eq!(Colors::BLUE_GREY, Colors::BLUE_GREY_500);
assert_eq!(Colors::RED_ACCENT, Colors::RED_ACCENT_200);
assert_eq!(Colors::DEEP_ORANGE_ACCENT, Colors::DEEP_ORANGE_ACCENT_200);
}
#[test]
fn ramps_are_ordered_and_have_the_expected_lengths() {
for ramp in Colors::PRIMARIES.iter().chain(Colors::ACCENTS.iter()) {
let steps: Vec<u16> = ramp.steps().map(|(s, _)| s).collect();
assert!(
steps.windows(2).all(|w| w[0] < w[1]),
"steps should ascend: {steps:?}"
);
}
assert_eq!(Colors::PRIMARIES.len(), 19);
assert_eq!(Colors::ACCENTS.len(), 16);
assert_eq!(MaterialColor::RED.len(), 10);
assert_eq!(MaterialColor::GREY.len(), 12);
assert_eq!(MaterialColor::RED_ACCENT.len(), 4);
}
#[test]
fn a_missing_step_answers_none_rather_than_the_nearest() {
assert_eq!(MaterialColor::RED.shade(350), None);
assert_eq!(MaterialColor::RED.shade(0), None);
assert_eq!(MaterialColor::RED_ACCENT.shade(300), None);
assert_eq!(MaterialColor::RED.shade_or_primary(350), Colors::RED);
}
#[test]
fn the_values_match_the_specification() {
assert_eq!(Colors::RED_500, Color::hex("#F44336"));
assert_eq!(Colors::BLUE_500, Color::hex("#2196F3"));
assert_eq!(Colors::GREEN_500, Color::hex("#4CAF50"));
assert_eq!(Colors::AMBER_500, Color::hex("#FFC107"));
assert_eq!(Colors::BLUE_GREY_900, Color::hex("#263238"));
assert_eq!(Colors::TEAL_ACCENT_400, Color::hex("#1DE9B6"));
assert_eq!(Colors::YELLOW_ACCENT_400, Color::hex("#FFEA00"));
assert_eq!(Colors::YELLOW_ACCENT_700, Color::hex("#FFD600"));
}
#[test]
fn the_neutrals_are_alphas_not_greys() {
assert_eq!(Colors::BLACK, Color::rgba(0.0, 0.0, 0.0, 1.0));
assert_eq!(Colors::WHITE, Color::rgba(1.0, 1.0, 1.0, 1.0));
assert_eq!(Colors::TRANSPARENT.a, 0.0);
for (c, pct) in [
(Colors::BLACK87, 0.87),
(Colors::BLACK54, 0.54),
(Colors::BLACK38, 0.38),
(Colors::BLACK12, 0.12),
] {
assert_eq!((c.r, c.g, c.b), (0.0, 0.0, 0.0), "the RGB stays black");
assert!((c.a - pct).abs() < 0.01, "{c:?} should be about {pct}");
}
for (c, pct) in [
(Colors::WHITE70, 0.70),
(Colors::WHITE54, 0.54),
(Colors::WHITE24, 0.24),
(Colors::WHITE10, 0.10),
] {
assert_eq!((c.r, c.g, c.b), (1.0, 1.0, 1.0), "the RGB stays white");
assert!((c.a - pct).abs() < 0.01, "{c:?} should be about {pct}");
}
}
#[test]
fn a_ramp_converts_to_its_primary() {
let color: Color = MaterialColor::INDIGO.into();
assert_eq!(color, Colors::INDIGO);
}
#[test]
fn steps_darken_as_they_climb() {
for ramp in Colors::PRIMARIES {
let lum: Vec<f32> = ramp.steps().map(|(_, c)| c.compute_luminance()).collect();
for pair in lum.windows(2) {
assert!(
pair[0] >= pair[1] - 0.005,
"a higher step should not be lighter: {lum:?}"
);
}
}
}
}