diff --git a/docs/src/modules/branding/ComparisonTable.tsx b/docs/src/modules/branding/ComparisonTable.tsx index 05ef80ef7b6a46..18aa69f9ffaf3b 100644 --- a/docs/src/modules/branding/ComparisonTable.tsx +++ b/docs/src/modules/branding/ComparisonTable.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { experimentalStyled as styled, fade } from '@material-ui/core/styles'; +import { experimentalStyled as styled, alpha } from '@material-ui/core/styles'; import Table from '@material-ui/core/Table'; import Box from '@material-ui/core/Box'; import TableBody from '@material-ui/core/TableBody'; @@ -72,7 +72,7 @@ function PlanStatus(props: PlanStatusProps) { {checkIcon ? ( fade(theme.palette.primary.main, 0.2), + bgcolor: (theme) => alpha(theme.palette.primary.main, 0.2), color: 'primary.main', borderRadius: '50%', p: 0.5, diff --git a/packages/material-ui/src/styles/colorManipulator.d.ts b/packages/material-ui/src/styles/colorManipulator.d.ts index c877a2ff9457c9..5f1dc06d9ef4b9 100644 --- a/packages/material-ui/src/styles/colorManipulator.d.ts +++ b/packages/material-ui/src/styles/colorManipulator.d.ts @@ -13,11 +13,6 @@ export function recomposeColor(color: ColorObject): string; export function getContrastRatio(foreground: string, background: string): number; export function getLuminance(color: string): number; export function emphasize(color: string, coefficient?: number): string; -/** - * @deprecated - * Use `import { alpha } from '@material-ui/core/styles'` instead. - */ -export function fade(color: string, value: number): string; export function alpha(color: string, value: number): string; export function darken(color: string, coefficient: number): string; export function lighten(color: string, coefficient: number): string; diff --git a/packages/material-ui/src/styles/colorManipulator.js b/packages/material-ui/src/styles/colorManipulator.js index d9a75e4154bd89..5b750c4151ba20 100644 --- a/packages/material-ui/src/styles/colorManipulator.js +++ b/packages/material-ui/src/styles/colorManipulator.js @@ -237,36 +237,6 @@ export function alpha(color, value) { return recomposeColor(color); } -let warnedOnce = false; - -/** - * Set the absolute transparency of a color. - * Any existing alpha values are overwritten. - * - * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() - * @param {number} value - value to set the alpha channel to in the range 0 -1 - * @returns {string} A CSS color string. Hex input values are returned as rgb - * - * @deprecated - * Use `import { alpha } from '@material-ui/core/styles'` instead. - */ -export function fade(color, value) { - if (process.env.NODE_ENV !== 'production') { - if (!warnedOnce) { - warnedOnce = true; - console.error( - [ - 'Material-UI: The `fade` color utility was renamed to `alpha` to better describe its functionality.', - '', - "You should use `import { alpha } from '@material-ui/core/styles'`", - ].join('\n'), - ); - } - } - - return alpha(color, value); -} - /** * Darkens a color. * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()