1 |
|
2 |
|
3 |
|
4 | export declare class Color {
|
5 | constructor(knownColor: string);
|
6 | constructor(hex: string);
|
7 | constructor(argb: number);
|
8 | constructor(alpha: number, red: number, green: number, blue: number, type?: 'rgb' | 'hsl' | 'hsv');
|
9 |
|
10 | /**
|
11 | * Gets the Alpha component (in the [0, 255] range) of this color. This is a read-only property.
|
12 | */
|
13 | public a: number;
|
14 |
|
15 | /**
|
16 | * Gets the Red component (in the [0, 255] range) of this color. This is a read-only property.
|
17 | */
|
18 | public r: number;
|
19 |
|
20 | /**
|
21 | * Gets the Green component (in the [0, 255] range) of this color. This is a read-only property.
|
22 | */
|
23 | public g: number;
|
24 |
|
25 | /**
|
26 | * Gets the Blue component (in the [0, 255] range) of this color. This is a read-only property.
|
27 | */
|
28 | public b: number;
|
29 |
|
30 | /**
|
31 | * Gets the Hexadecimal string representation of this color. This is a read-only property.
|
32 | */
|
33 | public hex: string;
|
34 |
|
35 | /**
|
36 | * Gets the Argb Number representation of this color where each 8 bits represent a single color component. This is a read-only property.
|
37 | */
|
38 | public argb: number;
|
39 |
|
40 | /**
|
41 | * Gets the known name of this instance. Defined only if it has been constructed from a known color name - e.g. "red". This is a read-only property.
|
42 | */
|
43 | public name: string;
|
44 |
|
45 | /**
|
46 | * Gets the android-specific integer value representation. Same as the Argb one. This is a read-only property.
|
47 | */
|
48 | android: number;
|
49 |
|
50 | /**
|
51 | * Gets the iOS-specific UIColor value representation. This is a read-only property.
|
52 | */
|
53 | ios: any /* UIColor */;
|
54 |
|
55 | /**
|
56 | * Specifies whether this Color is equal to the Color parameter.
|
57 | * @param value The Color to test.
|
58 | */
|
59 | public equals(value: Color): boolean;
|
60 |
|
61 | /**
|
62 | * Compares two Color instances.
|
63 | * @param value1 A Color to compare.
|
64 | * @param value2 A Color to compare.
|
65 | */
|
66 | public static equals(value1: Color, value2: Color): boolean;
|
67 |
|
68 | /**
|
69 | * Validates if a value can be converted to color.
|
70 | * @param value Input string.
|
71 | */
|
72 | public static isValid(value: any): boolean;
|
73 |
|
74 | /**
|
75 | * Creates color from iOS-specific UIColor value representation.
|
76 | */
|
77 | public static fromIosColor(value: any ): Color;
|
78 |
|
79 | /**
|
80 | * return true if brightenss < 128
|
81 | *
|
82 | */
|
83 | public isDark(): boolean;
|
84 |
|
85 | /**
|
86 | * return true if brightenss >= 128
|
87 | *
|
88 | */
|
89 | public isLight(): boolean;
|
90 |
|
91 | /**
|
92 | * return the [brightness](http:
|
93 | *
|
94 | */
|
95 | public getBrightness(): number;
|
96 | |
97 |
|
98 |
|
99 |
|
100 | public getLuminance(): number;
|
101 |
|
102 | |
103 |
|
104 |
|
105 |
|
106 |
|
107 | public setAlpha(a: number): Color;
|
108 | |
109 |
|
110 |
|
111 |
|
112 | public toHsl(): { h: number; s: number; l: number; a: number };
|
113 |
|
114 | |
115 |
|
116 |
|
117 |
|
118 | public toHslString(): string;
|
119 |
|
120 | |
121 |
|
122 |
|
123 |
|
124 | public toHsv(): { h: number; s: number; v: number; a: number };
|
125 |
|
126 | |
127 |
|
128 |
|
129 |
|
130 | public toHsvString(): string;
|
131 |
|
132 | |
133 |
|
134 |
|
135 |
|
136 | public toRgbString(): string;
|
137 |
|
138 | |
139 |
|
140 |
|
141 |
|
142 |
|
143 | public desaturate(amount: number): Color;
|
144 |
|
145 | |
146 |
|
147 |
|
148 |
|
149 |
|
150 | public saturate(amount: number): Color;
|
151 |
|
152 | |
153 |
|
154 |
|
155 |
|
156 |
|
157 | public greyscale(): Color;
|
158 |
|
159 | |
160 |
|
161 |
|
162 |
|
163 |
|
164 |
|
165 | public lighten(amount: number): Color;
|
166 |
|
167 | |
168 |
|
169 |
|
170 |
|
171 |
|
172 | public brighten(amount: number): Color;
|
173 |
|
174 | |
175 |
|
176 |
|
177 |
|
178 |
|
179 | public darken(amount: number): Color;
|
180 |
|
181 | |
182 |
|
183 |
|
184 |
|
185 |
|
186 | public spin(amount: number): Color;
|
187 |
|
188 | |
189 |
|
190 |
|
191 |
|
192 | public complement(): Color;
|
193 |
|
194 | |
195 |
|
196 |
|
197 |
|
198 | public static mix(color1: Color, color2: Color, amount: number): Color;
|
199 |
|
200 | |
201 |
|
202 |
|
203 |
|
204 | public static fromHSL(a, h, s, l): Color;
|
205 | public static fromHSV(a, h, s, l): Color;
|
206 | }
|
207 |
|
\ | No newline at end of file |