1
💡 Accessibility & Contrast
The relative luminance of the color (0.0=black, 1.0=white). Essential for contrast calculations.
Checks if the color is perceived as dark (
luminance < 0.5). Use this to decide if white text should be used.Checks if the color is perceived as light (
luminance ≥ 0.5). Use this to decide if dark text should be used.2
3
🎨 The Swatch Creator
Generates a full 10-shade
MaterialColor swatch (50-900) from a single base color. The ultimate shortcut for ThemeData.primarySwatch.