-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshadows.d.ts
31 lines (31 loc) · 1.21 KB
/
shadows.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* This module is used at providing an easy way to override material-ui
* `shadows` properties.
* material-ui expects the shadows to be following a certain pattern.
* (source: https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/styles/shadows.js)
* This file is a slight adaptation (for colours) of the above material-ui source file.
*
* This module exports a `createShadows(hexColor: string): Array<string>` method
* that takes a hex color (presumably from the configuration) and returns an array
* of the 25 possible shadows matching the 25 elevations in material-ui.
*
* It’s convoluted, but it’s the official way:
* https://github.com/mui-org/material-ui/issues/8780#issuecomment-338480079
*/
/**
* Returns the {r, g, b} version of an hex color
* Source: https://stackoverflow.com/a/5624139/4075255
*
* Exported for testing purposes only.
*/
export declare const hexToRgb: (hex: any) => {
r: number;
g: number;
b: number;
};
/**
* Takes a hex color (presumably from the configuration) and returns an array
* of the 25 possible shadows matching the 25 elevations in material-ui.
*/
declare const createShadows: (hexColor: string) => string[];
export default createShadows;