UNPKG

1.81 kBTypeScriptView Raw
1/**
2 * Either be a reference to an existing color or a color value as a hex string, rgba, or hsla.
3 */
4export declare type Color = string | RGBA | HSLA | ColorTransformation;
5export declare namespace Color {
6 function rgba(r: number, g: number, b: number, a?: number): Color;
7 function hsla(h: number, s: number, l: number, a?: number): Color;
8 const white: Color;
9 const black: Color;
10 function transparent(v: string, f: number): ColorTransformation;
11 function lighten(v: string, f: number): ColorTransformation;
12 function darken(v: string, f: number): ColorTransformation;
13}
14export interface ColorTransformation {
15 kind: 'transparent' | 'lighten' | 'darken';
16 v: string;
17 f: number;
18}
19export interface RGBA {
20 /**
21 * Red: integer in [0-255]
22 */
23 readonly r: number;
24 /**
25 * Green: integer in [0-255]
26 */
27 readonly g: number;
28 /**
29 * Blue: integer in [0-255]
30 */
31 readonly b: number;
32 /**
33 * Alpha: float in [0-1]
34 */
35 readonly a: number;
36}
37export interface HSLA {
38 /**
39 * Hue: integer in [0, 360]
40 */
41 readonly h: number;
42 /**
43 * Saturation: float in [0, 1]
44 */
45 readonly s: number;
46 /**
47 * Luminosity: float in [0, 1]
48 */
49 readonly l: number;
50 /**
51 * Alpha: float in [0, 1]
52 */
53 readonly a: number;
54}
55export interface ColorDefaults {
56 light?: Color;
57 dark?: Color;
58 /** @deprecated @since 1.28.0 Please use hcDark and hcLight. This field will be ignored unless `hcDark` is absent. */
59 hc?: Color;
60 hcDark?: Color;
61 hcLight?: Color;
62}
63export interface ColorDefinition {
64 id: string;
65 defaults?: ColorDefaults;
66 description: string;
67}
68export interface ColorCssVariable {
69 name: string;
70 value: string;
71}
72//# sourceMappingURL=color.d.ts.map
\No newline at end of file