Color Palette Customization
The palette is the foundation of your application’s color system. Material UI provides a comprehensive palette structure that supports light and dark modes.Default Palette Colors
Material UI comes with default color values for light mode: Light Mode Defaults:- Primary:
blue[700](#1976d2) - Secondary:
purple[500](#9c27b0) - Error:
red[700](#d32f2f) - Warning:
#ed6c02(optimized for 3:1 contrast) - Info:
lightBlue[700](#0288d1) - Success:
green[800](#2e7d32)
- Primary:
blue[200](#90caf9) - Secondary:
purple[200](#ce93d8) - Error:
red[500](#f44336) - Warning:
orange[400](#ffa726) - Info:
lightBlue[400](#29b6f6) - Success:
green[400](#66bb6a)
Palette Structure
Each color in the palette has the following structure:Basic Customization
Using Material UI Colors
Import pre-defined color palettes:Available Color Palettes
Each color has shades from 50 to 900, plus accent shades (A100, A200, A400, A700): Blue:Common Colors
Auto-generated Variants
When you only providemain, Material UI automatically generates light and dark variants:
Tonal Offset
Control how light and dark variants are generated:Text Colors
Light Mode:Background Colors
Light Mode:Action Colors
Light Mode:Divider Color
Light Mode:rgba(0, 0, 0, 0.12)
Dark Mode: rgba(255, 255, 255, 0.12)
Contrast Threshold
ThecontrastThreshold determines when to use light vs dark text:
Augment Color Function
Manually augment colors with theaugmentColor helper:
Get Contrast Text
Get text color that contrasts with a background:Source Reference
The palette implementation can be found at:packages/mui-material/src/styles/createPalette.js:211- Color definitions:
packages/mui-material/src/colors/ - Light mode defaults:
packages/mui-material/src/styles/createPalette.js:12 - Dark mode defaults:
packages/mui-material/src/styles/createPalette.js:55