返回 reveal.js
color.d.ts
根目录 / dist / utils / color.d.ts
1 /**
2 * Converts various color input formats to an {r:0,g:0,b:0} object.
3 *
4 * @param {string} color The string representation of a color
5 * @example
6 * colorToRgb('#000');
7 * @example
8 * colorToRgb('#000000');
9 * @example
10 * colorToRgb('rgb(0,0,0)');
11 * @example
12 * colorToRgb('rgba(0,0,0)');
13 *
14 * @return {{r: number, g: number, b: number, [a]: number}|null}
15 */
16 export declare const colorToRgb: (color: string) => {
17 r: number;
18 g: number;
19 b: number;
20 a?: undefined;
21 } | {
22 r: number;
23 g: number;
24 b: number;
25 a: number;
26 } | null;
27 /**
28 * Calculates brightness on a scale of 0-255.
29 *
30 * @param {string} color See colorToRgb for supported formats.
31 * @see {@link colorToRgb}
32 */
33 export declare const colorBrightness: (color: string | {
34 r: number;
35 g: number;
36 b: number;
37 } | null) => number | null;
38
38 lines TYPESCRIPT