UNPKG

521 BJavaScriptView Raw
1import { getPath } from '@mui/system/style';
2import { alpha } from '@mui/system/colorManipulator';
3const getTextDecoration = ({
4 theme,
5 ownerState
6}) => {
7 const transformedColor = ownerState.color;
8 const color = getPath(theme, `palette.${transformedColor}`, false) || ownerState.color;
9 const channelColor = getPath(theme, `palette.${transformedColor}Channel`);
10 if ('vars' in theme && channelColor) {
11 return `rgba(${channelColor} / 0.4)`;
12 }
13 return alpha(color, 0.4);
14};
15export default getTextDecoration;
\No newline at end of file