The Material-UI docs for React say that light and dark variants of your primary and secondary colors will be calculated automatically.
(From the docs: https://material-ui.com/customization/palette/)
const theme = createMuiTheme({
palette: {
primary: {
// light: will be calculated from palette.primary.main,
main: '#ff4400',
// dark: will be calculated from palette.primary.main,
What I can't seem to find is how to access these colors for use in my components. After implementing a theme like so:
const theme = createMuiTheme({
palette: {
secondary: {
main: '#287a9f'
}
}
})
How would I then specify that I'd like a component to use the light variant of the secondary color? Something like:
<AppBar color="Primary.light" />
I could certainly just implement them manually as custom colors, but this seems to defeat the purpose of automatic calculation.
Wisdom much appreciated.