import { createTheme, ThemeProvider, useTheme } from '@mui/material/styles'; import PropTypes from 'prop-types'; import { blue } from '@mui/material/colors'; import Box from '@mui/material/Box'; import Stack from '@mui/material/Stack'; import Typography from '@mui/material/Typography'; const defaultTonalOffsetTheme = createTheme({ palette: { primary: { main: blue[500], }, }, }); const higherTonalOffsetTheme = createTheme({ palette: { primary: { main: blue[500], }, tonalOffset: 0.5, }, }); const asymmetricTonalOffsetTheme = createTheme({ palette: { primary: { main: blue[500], }, tonalOffset: { light: 0.1, dark: 0.9, }, }, }); function ColorShowcase({ title, color }) { const { palette: { tonalOffset }, } = useTheme(); let caption; if (typeof tonalOffset === 'number') { caption = tonalOffset; } else { caption = `{ light: ${tonalOffset.light}, dark: ${tonalOffset.dark} }`; } return ( {title} {caption} light main dark ); } ColorShowcase.propTypes = { color: PropTypes.string.isRequired, title: PropTypes.string.isRequired, }; export default function TonalOffset() { return ( ); }