Skip to content

Commit d579749

Browse files
committed
[theme] Remove fade color helper
1 parent de07013 commit d579749

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

packages/material-ui/src/styles/colorManipulator.d.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ export function recomposeColor(color: ColorObject): string;
1313
export function getContrastRatio(foreground: string, background: string): number;
1414
export function getLuminance(color: string): number;
1515
export function emphasize(color: string, coefficient?: number): string;
16-
/**
17-
* @deprecated
18-
* Use `import { alpha } from '@material-ui/core/styles'` instead.
19-
*/
20-
export function fade(color: string, value: number): string;
2116
export function alpha(color: string, value: number): string;
2217
export function darken(color: string, coefficient: number): string;
2318
export function lighten(color: string, coefficient: number): string;

packages/material-ui/src/styles/colorManipulator.js

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -237,36 +237,6 @@ export function alpha(color, value) {
237237
return recomposeColor(color);
238238
}
239239

240-
let warnedOnce = false;
241-
242-
/**
243-
* Set the absolute transparency of a color.
244-
* Any existing alpha values are overwritten.
245-
*
246-
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
247-
* @param {number} value - value to set the alpha channel to in the range 0 -1
248-
* @returns {string} A CSS color string. Hex input values are returned as rgb
249-
*
250-
* @deprecated
251-
* Use `import { alpha } from '@material-ui/core/styles'` instead.
252-
*/
253-
export function fade(color, value) {
254-
if (process.env.NODE_ENV !== 'production') {
255-
if (!warnedOnce) {
256-
warnedOnce = true;
257-
console.error(
258-
[
259-
'Material-UI: The `fade` color utility was renamed to `alpha` to better describe its functionality.',
260-
'',
261-
"You should use `import { alpha } from '@material-ui/core/styles'`",
262-
].join('\n'),
263-
);
264-
}
265-
}
266-
267-
return alpha(color, value);
268-
}
269-
270240
/**
271241
* Darkens a color.
272242
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()

0 commit comments

Comments
 (0)