@mui/material
Version:
Material UI is an open-source React component library that implements Google's Material Design. It's comprehensive and can be used in production out of the box.
16 lines • 733 B
JavaScript
import { getPath } from '@mui/system/style';
import { alpha } from '@mui/system/colorManipulator';
const getTextDecoration = ({
theme,
ownerState
}) => {
const transformedColor = ownerState.color;
// check the `main` color first for a custom palette, then fallback to the color itself
const color = getPath(theme, `palette.${transformedColor}.main`, false) || getPath(theme, `palette.${transformedColor}`, false) || ownerState.color;
const channelColor = getPath(theme, `palette.${transformedColor}.mainChannel`) || getPath(theme, `palette.${transformedColor}Channel`);
if ('vars' in theme && channelColor) {
return `rgba(${channelColor} / 0.4)`;
}
return alpha(color, 0.4);
};
export default getTextDecoration;