setColor(palette.background,'defaultChannel',safeColorChannel(palette.background.default,'MUI: The value of `palette.background.default` should be one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().'));// MUI X - DataGrid needs this token.
setColor(palette.common,'backgroundChannel',safeColorChannel(palette.common.background,'MUI: The value of `palette.common.background` should be one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().'));
setColor(palette.common,'onBackgroundChannel',safeColorChannel(palette.common.onBackground,'MUI: The value of `palette.common.onBackground` should be one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().'));
setColor(palette,'dividerChannel',safeColorChannel(palette.divider,'MUI: The value of `palette.divider` should be one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().'));
Object.keys(palette).forEach(color=>{
constcolors=palette[color];
// The default palettes (primary, secondary, error, info, success, and warning) errors are handled by the above `createTheme(...)`.
setColor(palette[color],'primaryChannel',safeColorChannel(colors.primary,'MUI: The value of `palette.text.primary` should be one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().'));
setColor(palette[color],'secondaryChannel',safeColorChannel(colors.secondary,'MUI: The value of `palette.text.secondary` should be one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().'));
}
if(color==='action'){
// Action colors: action.active, action.selected
if(colors.active){
setColor(palette[color],'activeChannel',safeColorChannel(colors.active,'MUI: The value of `palette.action.active` should be one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().'));
}
if(colors.selected){
setColor(palette[color],'selectedChannel',safeColorChannel(colors.selected,'MUI: The value of `palette.action.selected` should be one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().'));