[NUI] Fix NUI Svace issue (#2806)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Common / Color.cs
1 /*
2  * Copyright(c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 using System;
19 using Tizen.NUI.Binding;
20 using System.ComponentModel;
21
22 namespace Tizen.NUI
23 {
24     /// <summary>
25     /// The Color class.
26     /// </summary>
27     [Tizen.NUI.Binding.TypeConverter(typeof(ColorTypeConverter))]
28     public class Color : Disposable, ICloneable
29     {
30         /// <summary>
31         /// Gets the alice_blue colored Color class.
32         /// </summary>
33         [EditorBrowsable(EditorBrowsableState.Never)]
34         public static readonly Color AliceBlue = NDalic.ALICE_BLUE;
35
36         /// <summary>
37         /// Gets the antique_white colored Color class.
38         /// </summary>
39         [EditorBrowsable(EditorBrowsableState.Never)]
40         public static readonly Color AntiqueWhite = NDalic.ANTIQUE_WHITE;
41
42         /// <summary>
43         /// Gets the aqua colored Color class.
44         /// </summary>
45         [EditorBrowsable(EditorBrowsableState.Never)]
46         public static readonly Color Aqua = NDalic.AQUA;
47
48         /// <summary>
49         /// Gets the aqua_marine colored Color class.
50         /// </summary>
51         [EditorBrowsable(EditorBrowsableState.Never)]
52         public static readonly Color AquaMarine = NDalic.AQUA_MARINE;
53
54         /// <summary>
55         /// Gets the azure colored Color class.
56         /// </summary>
57         [EditorBrowsable(EditorBrowsableState.Never)]
58         public static readonly Color Azure = NDalic.AZURE;
59
60         /// <summary>
61         /// Gets the beige colored Color class.
62         /// </summary>
63         [EditorBrowsable(EditorBrowsableState.Never)]
64         public static readonly Color Beige = NDalic.BEIGE;
65
66         /// <summary>
67         /// Gets the bisque colored Color class.
68         /// </summary>
69         [EditorBrowsable(EditorBrowsableState.Never)]
70         public static readonly Color Bisque = NDalic.BISQUE;
71
72         /// <summary>
73         /// Gets the black colored Color class.
74         /// </summary>
75         /// <since_tizen> 3 </since_tizen>
76         public static readonly Color Black = NDalic.BLACK;
77
78         /// <summary>
79         /// Gets the blanche_dalmond colored Color class.
80         /// </summary>
81         [EditorBrowsable(EditorBrowsableState.Never)]
82         public static readonly Color BlancheDalmond = NDalic.BLANCHE_DALMOND;
83
84         /// <summary>
85         /// Gets the blue colored Color class.
86         /// </summary>
87         /// <since_tizen> 3 </since_tizen>
88         public static readonly Color Blue = NDalic.BLUE;
89
90         /// <summary>
91         /// Gets the blue_violet colored Color class.
92         /// </summary>
93         [EditorBrowsable(EditorBrowsableState.Never)]
94         public static readonly Color BlueViolet = NDalic.BLUE_VIOLET;
95
96         /// <summary>
97         /// Gets the brown colored Color class.
98         /// </summary>
99         [EditorBrowsable(EditorBrowsableState.Never)]
100         public static readonly Color Brown = NDalic.BROWN;
101
102         /// <summary>
103         /// Gets the burly_wood colored Color class.
104         /// </summary>
105         [EditorBrowsable(EditorBrowsableState.Never)]
106         public static readonly Color BurlyWood = NDalic.BURLY_WOOD;
107
108         /// <summary>
109         /// Gets the cadet_blue colored Color class.
110         /// </summary>
111         [EditorBrowsable(EditorBrowsableState.Never)]
112         public static readonly Color CadetBlue = NDalic.CADET_BLUE;
113
114         /// <summary>
115         /// Gets the chartreuse colored Color class.
116         /// </summary>
117         [EditorBrowsable(EditorBrowsableState.Never)]
118         public static readonly Color Chartreuse = NDalic.CHARTREUSE;
119
120         /// <summary>
121         /// Gets the chocolate colored Color class.
122         /// </summary>
123         [EditorBrowsable(EditorBrowsableState.Never)]
124         public static readonly Color Chocolate = NDalic.CHOCOLATE;
125
126         /// <summary>
127         /// Gets the coral colored Color class.
128         /// </summary>
129         [EditorBrowsable(EditorBrowsableState.Never)]
130         public static readonly Color Coral = NDalic.CORAL;
131
132         /// <summary>
133         /// Gets the cornflower_blue colored Color class.
134         /// </summary>
135         [EditorBrowsable(EditorBrowsableState.Never)]
136         public static readonly Color CornflowerBlue = NDalic.CORNFLOWER_BLUE;
137
138         /// <summary>
139         /// Gets the cornsilk colored Color class.
140         /// </summary>
141         [EditorBrowsable(EditorBrowsableState.Never)]
142         public static readonly Color Cornsilk = NDalic.CORNSILK;
143
144         /// <summary>
145         /// Gets the crimson colored Color class.
146         /// </summary>
147         [EditorBrowsable(EditorBrowsableState.Never)]
148         public static readonly Color Crimson = NDalic.CRIMSON;
149
150         /// <summary>
151         /// Gets the cyan colored Color class.
152         /// </summary>
153         /// <since_tizen> 3 </since_tizen>
154         public static readonly Color Cyan = NDalic.CYAN;
155
156         /// <summary>
157         /// Gets the dark_blue colored Color class.
158         /// </summary>
159         [EditorBrowsable(EditorBrowsableState.Never)]
160         public static readonly Color DarkBlue = NDalic.DARK_BLUE;
161
162         /// <summary>
163         /// Gets the dark_cyan colored Color class.
164         /// </summary>
165         [EditorBrowsable(EditorBrowsableState.Never)]
166         public static readonly Color DarkCyan = NDalic.DARK_CYAN;
167
168         /// <summary>
169         /// Gets the dark_goldenrod colored Color class.
170         /// </summary>
171         [EditorBrowsable(EditorBrowsableState.Never)]
172         public static readonly Color DarkGoldenrod = NDalic.DARK_GOLDENROD;
173
174         /// <summary>
175         /// Gets the dark_gray colored Color class.
176         /// </summary>
177         [EditorBrowsable(EditorBrowsableState.Never)]
178         public static readonly Color DarkGray = NDalic.DARK_GRAY;
179
180         /// <summary>
181         /// Gets the dark_green colored Color class.
182         /// </summary>
183         [EditorBrowsable(EditorBrowsableState.Never)]
184         public static readonly Color DarkGreen = NDalic.DARK_GREEN;
185
186         /// <summary>
187         /// Gets the dark_grey colored Color class.
188         /// </summary>
189         [EditorBrowsable(EditorBrowsableState.Never)]
190         public static readonly Color DarkGrey = NDalic.DARK_GREY;
191
192         /// <summary>
193         /// Gets the dark_khaki colored Color class.
194         /// </summary>
195         [EditorBrowsable(EditorBrowsableState.Never)]
196         public static readonly Color DarkKhaki = NDalic.DARK_KHAKI;
197
198         /// <summary>
199         /// Gets the dark_magenta colored Color class.
200         /// </summary>
201         [EditorBrowsable(EditorBrowsableState.Never)]
202         public static readonly Color DarkMagenta = NDalic.DARK_MAGENTA;
203
204         /// <summary>
205         /// Gets the dark_olive_green colored Color class.
206         /// </summary>
207         [EditorBrowsable(EditorBrowsableState.Never)]
208         public static readonly Color DarkOliveGreen = NDalic.DARK_OLIVE_GREEN;
209
210         /// <summary>
211         /// Gets the dark_orange colored Color class.
212         /// </summary>
213         [EditorBrowsable(EditorBrowsableState.Never)]
214         public static readonly Color DarkOrange = NDalic.DARK_ORANGE;
215
216         /// <summary>
217         /// Gets the dark_orchid colored Color class.
218         /// </summary>
219         [EditorBrowsable(EditorBrowsableState.Never)]
220         public static readonly Color DarkOrchid = NDalic.DARK_ORCHID;
221
222         /// <summary>
223         /// Gets the dark_red colored Color class.
224         /// </summary>
225         [EditorBrowsable(EditorBrowsableState.Never)]
226         public static readonly Color DarkRed = NDalic.DARK_RED;
227
228         /// <summary>
229         /// Gets the dark_salmon colored Color class.
230         /// </summary>
231         [EditorBrowsable(EditorBrowsableState.Never)]
232         public static readonly Color DarkSalmon = NDalic.DARK_SALMON;
233
234         /// <summary>
235         /// Gets the dark_sea_green colored Color class.
236         /// </summary>
237         [EditorBrowsable(EditorBrowsableState.Never)]
238         public static readonly Color DarkSeaGreen = NDalic.DARK_SEA_GREEN;
239
240         /// <summary>
241         /// Gets the dark_slate_blue colored Color class.
242         /// </summary>
243         [EditorBrowsable(EditorBrowsableState.Never)]
244         public static readonly Color DarkSlateBlue = NDalic.DARK_SLATE_BLUE;
245
246         /// <summary>
247         /// Gets the dark_slate_gray colored Color class.
248         /// </summary>
249         [EditorBrowsable(EditorBrowsableState.Never)]
250         public static readonly Color DarkSlateGray = NDalic.DARK_SLATE_GRAY;
251
252         /// <summary>
253         /// Gets the dark_slate_grey colored Color class.
254         /// </summary>
255         [EditorBrowsable(EditorBrowsableState.Never)]
256         public static readonly Color DarkSlateGrey = NDalic.DARK_SLATE_GREY;
257
258         /// <summary>
259         /// Gets the dark_turquoise colored Color class.
260         /// </summary>
261         [EditorBrowsable(EditorBrowsableState.Never)]
262         public static readonly Color DarkTurquoise = NDalic.DARK_TURQUOISE;
263
264         /// <summary>
265         /// Gets the dark_violet colored Color class.
266         /// </summary>
267         [EditorBrowsable(EditorBrowsableState.Never)]
268         public static readonly Color DarkViolet = NDalic.DARK_VIOLET;
269
270         /// <summary>
271         /// Gets the deep_pink colored Color class.
272         /// </summary>
273         [EditorBrowsable(EditorBrowsableState.Never)]
274         public static readonly Color DeepPink = NDalic.DEEP_PINK;
275
276         /// <summary>
277         /// Gets the deep_sky_blue colored Color class.
278         /// </summary>
279         [EditorBrowsable(EditorBrowsableState.Never)]
280         public static readonly Color DeepSkyBlue = NDalic.DEEP_SKY_BLUE;
281
282         /// <summary>
283         /// Gets the dim_gray colored Color class.
284         /// </summary>
285         [EditorBrowsable(EditorBrowsableState.Never)]
286         public static readonly Color DimGray = NDalic.DIM_GRAY;
287
288         /// <summary>
289         /// Gets the dim_grey colored Color class.
290         /// </summary>
291         [EditorBrowsable(EditorBrowsableState.Never)]
292         public static readonly Color DimGrey = NDalic.DIM_GREY;
293
294         /// <summary>
295         /// Gets the dodger_blue colored Color class.
296         /// </summary>
297         [EditorBrowsable(EditorBrowsableState.Never)]
298         public static readonly Color DodgerBlue = NDalic.DODGER_BLUE;
299
300         /// <summary>
301         /// Gets the fire_brick colored Color class.
302         /// </summary>
303         [EditorBrowsable(EditorBrowsableState.Never)]
304         public static readonly Color FireBrick = NDalic.FIRE_BRICK;
305
306         /// <summary>
307         /// Gets the floral_white colored Color class.
308         /// </summary>
309         [EditorBrowsable(EditorBrowsableState.Never)]
310         public static readonly Color FloralWhite = NDalic.FLORAL_WHITE;
311
312         /// <summary>
313         /// Gets the forest_green colored Color class.
314         /// </summary>
315         [EditorBrowsable(EditorBrowsableState.Never)]
316         public static readonly Color ForestGreen = NDalic.FOREST_GREEN;
317
318         /// <summary>
319         /// Gets the fuchsia colored Color class.
320         /// </summary>
321         [EditorBrowsable(EditorBrowsableState.Never)]
322         public static readonly Color Fuchsia = NDalic.FUCHSIA;
323
324         /// <summary>
325         /// Gets the gainsboro colored Color class.
326         /// </summary>
327         [EditorBrowsable(EditorBrowsableState.Never)]
328         public static readonly Color Gainsboro = NDalic.GAINSBORO;
329
330         /// <summary>
331         /// Gets the ghost_white colored Color class.
332         /// </summary>
333         [EditorBrowsable(EditorBrowsableState.Never)]
334         public static readonly Color GhostWhite = NDalic.GHOST_WHITE;
335
336         /// <summary>
337         /// Gets the gold colored Color class.
338         /// </summary>
339         [EditorBrowsable(EditorBrowsableState.Never)]
340         public static readonly Color Gold = NDalic.GOLD;
341
342         /// <summary>
343         /// Gets the golden_rod colored Color class.
344         /// </summary>
345         [EditorBrowsable(EditorBrowsableState.Never)]
346         public static readonly Color GoldenRod = NDalic.GOLDEN_ROD;
347
348         /// <summary>
349         /// Gets the gray colored Color class.
350         /// </summary>
351         [EditorBrowsable(EditorBrowsableState.Never)]
352         public static readonly Color Gray = NDalic.GRAY;
353
354         /// <summary>
355         /// Gets the green colored Color class.
356         /// </summary>
357         /// <since_tizen> 3 </since_tizen>
358         public static readonly Color Green = NDalic.GREEN;
359
360         /// <summary>
361         /// Gets the green_yellow colored Color class.
362         /// </summary>
363         [EditorBrowsable(EditorBrowsableState.Never)]
364         public static readonly Color GreenYellow = NDalic.GREEN_YELLOW;
365
366         /// <summary>
367         /// Gets the grey colored Color class.
368         /// </summary>
369         [EditorBrowsable(EditorBrowsableState.Never)]
370         public static readonly Color Grey = NDalic.GREY;
371
372         /// <summary>
373         /// Gets the honeydew colored Color class.
374         /// </summary>
375         [EditorBrowsable(EditorBrowsableState.Never)]
376         public static readonly Color Honeydew = NDalic.HONEYDEW;
377
378         /// <summary>
379         /// Gets the hot_pink colored Color class.
380         /// </summary>
381         [EditorBrowsable(EditorBrowsableState.Never)]
382         public static readonly Color HotPink = NDalic.HOT_PINK;
383
384         /// <summary>
385         /// Gets the indianred colored Color class.
386         /// </summary>
387         [EditorBrowsable(EditorBrowsableState.Never)]
388         public static readonly Color Indianred = NDalic.INDIANRED;
389
390         /// <summary>
391         /// Gets the indigo colored Color class.
392         /// </summary>
393         [EditorBrowsable(EditorBrowsableState.Never)]
394         public static readonly Color Indigo = NDalic.INDIGO;
395
396         /// <summary>
397         /// Gets the ivory colored Color class.
398         /// </summary>
399         [EditorBrowsable(EditorBrowsableState.Never)]
400         public static readonly Color Ivory = NDalic.IVORY;
401
402         /// <summary>
403         /// Gets the khaki colored Color class.
404         /// </summary>
405         [EditorBrowsable(EditorBrowsableState.Never)]
406         public static readonly Color Khaki = NDalic.KHAKI;
407
408         /// <summary>
409         /// Gets the lavender colored Color class.
410         /// </summary>
411         [EditorBrowsable(EditorBrowsableState.Never)]
412         public static readonly Color Lavender = NDalic.LAVENDER;
413
414         /// <summary>
415         /// Gets the lavender_blush colored Color class.
416         /// </summary>
417         [EditorBrowsable(EditorBrowsableState.Never)]
418         public static readonly Color LavenderBlush = NDalic.LAVENDER_BLUSH;
419
420         /// <summary>
421         /// Gets the lawn_green colored Color class.
422         /// </summary>
423         [EditorBrowsable(EditorBrowsableState.Never)]
424         public static readonly Color LawnGreen = NDalic.LAWN_GREEN;
425
426         /// <summary>
427         /// Gets the lemon_chiffon colored Color class.
428         /// </summary>
429         [EditorBrowsable(EditorBrowsableState.Never)]
430         public static readonly Color LemonChiffon = NDalic.LEMON_CHIFFON;
431
432         /// <summary>
433         /// Gets the light_blue colored Color class.
434         /// </summary>
435         [EditorBrowsable(EditorBrowsableState.Never)]
436         public static readonly Color LightBlue = NDalic.LIGHT_BLUE;
437
438         /// <summary>
439         /// Gets the light_coral colored Color class.
440         /// </summary>
441         [EditorBrowsable(EditorBrowsableState.Never)]
442         public static readonly Color LightCoral = NDalic.LIGHT_CORAL;
443
444         /// <summary>
445         /// Gets the light_cyan colored Color class.
446         /// </summary>
447         [EditorBrowsable(EditorBrowsableState.Never)]
448         public static readonly Color LightCyan = NDalic.LIGHT_CYAN;
449
450         /// <summary>
451         /// Gets the light_golden_rod_yellow colored Color class.
452         /// </summary>
453         [EditorBrowsable(EditorBrowsableState.Never)]
454         public static readonly Color LightGoldenRodYellow = NDalic.LIGHT_GOLDEN_ROD_YELLOW;
455
456         /// <summary>
457         /// Gets the light_gray colored Color class.
458         /// </summary>
459         [EditorBrowsable(EditorBrowsableState.Never)]
460         public static readonly Color LightGray = NDalic.LIGHT_GRAY;
461
462         /// <summary>
463         /// Gets the light_green colored Color class.
464         /// </summary>
465         [EditorBrowsable(EditorBrowsableState.Never)]
466         public static readonly Color LightGreen = NDalic.LIGHT_GREEN;
467
468         /// <summary>
469         /// Gets the light_grey colored Color class.
470         /// </summary>
471         [EditorBrowsable(EditorBrowsableState.Never)]
472         public static readonly Color LightGrey = NDalic.LIGHT_GREY;
473
474         /// <summary>
475         /// Gets the light_pink colored Color class.
476         /// </summary>
477         [EditorBrowsable(EditorBrowsableState.Never)]
478         public static readonly Color LightPink = NDalic.LIGHT_PINK;
479
480         /// <summary>
481         /// Gets the light_salmon colored Color class.
482         /// </summary>
483         [EditorBrowsable(EditorBrowsableState.Never)]
484         public static readonly Color LightSalmon = NDalic.LIGHT_SALMON;
485
486         /// <summary>
487         /// Gets the light_sea_green colored Color class.
488         /// </summary>
489         [EditorBrowsable(EditorBrowsableState.Never)]
490         public static readonly Color LightSeaGreen = NDalic.LIGHT_SEA_GREEN;
491
492         /// <summary>
493         /// Gets the light_sky_blue colored Color class.
494         /// </summary>
495         [EditorBrowsable(EditorBrowsableState.Never)]
496         public static readonly Color LightSkyBlue = NDalic.LIGHT_SKY_BLUE;
497
498         /// <summary>
499         /// Gets the light_slate_gray colored Color class.
500         /// </summary>
501         [EditorBrowsable(EditorBrowsableState.Never)]
502         public static readonly Color LightSlateGray = NDalic.LIGHT_SLATE_GRAY;
503
504         /// <summary>
505         /// Gets the light_slate_grey colored Color class.
506         /// </summary>
507         [EditorBrowsable(EditorBrowsableState.Never)]
508         public static readonly Color LightSlateGrey = NDalic.LIGHT_SLATE_GREY;
509
510         /// <summary>
511         /// Gets the light_steel_blue colored Color class.
512         /// </summary>
513         [EditorBrowsable(EditorBrowsableState.Never)]
514         public static readonly Color LightSteelBlue = NDalic.LIGHT_STEEL_BLUE;
515
516         /// <summary>
517         /// Gets the light_yellow colored Color class.
518         /// </summary>
519         [EditorBrowsable(EditorBrowsableState.Never)]
520         public static readonly Color LightYellow = NDalic.LIGHT_YELLOW;
521
522         /// <summary>
523         /// Gets the lime colored Color class.
524         /// </summary>
525         [EditorBrowsable(EditorBrowsableState.Never)]
526         public static readonly Color Lime = NDalic.LIME;
527
528         /// <summary>
529         /// Gets the lime_green colored Color class.
530         /// </summary>
531         [EditorBrowsable(EditorBrowsableState.Never)]
532         public static readonly Color LimeGreen = NDalic.LIME_GREEN;
533
534         /// <summary>
535         /// Gets the linen colored Color class.
536         /// </summary>
537         [EditorBrowsable(EditorBrowsableState.Never)]
538         public static readonly Color Linen = NDalic.LINEN;
539
540         /// <summary>
541         /// Gets the magenta colored Color class.
542         /// </summary>
543         /// <since_tizen> 3 </since_tizen>
544         public static readonly Color Magenta = NDalic.MAGENTA;
545
546         /// <summary>
547         /// Gets the maroon colored Color class.
548         /// </summary>
549         [EditorBrowsable(EditorBrowsableState.Never)]
550         public static readonly Color Maroon = NDalic.MAROON;
551
552         /// <summary>
553         /// Gets the medium_aqua_marine colored Color class.
554         /// </summary>
555         [EditorBrowsable(EditorBrowsableState.Never)]
556         public static readonly Color MediumAquaMarine = NDalic.MEDIUM_AQUA_MARINE;
557
558         /// <summary>
559         /// Gets the medium_blue colored Color class.
560         /// </summary>
561         [EditorBrowsable(EditorBrowsableState.Never)]
562         public static readonly Color MediumBlue = NDalic.MEDIUM_BLUE;
563
564         /// <summary>
565         /// Gets the medium_orchid colored Color class.
566         /// </summary>
567         [EditorBrowsable(EditorBrowsableState.Never)]
568         public static readonly Color MediumOrchid = NDalic.MEDIUM_ORCHID;
569
570         /// <summary>
571         /// Gets the medium_purple colored Color class.
572         /// </summary>
573         [EditorBrowsable(EditorBrowsableState.Never)]
574         public static readonly Color MediumPurple = NDalic.MEDIUM_PURPLE;
575
576         /// <summary>
577         /// Gets the medium_sea_green colored Color class.
578         /// </summary>
579         [EditorBrowsable(EditorBrowsableState.Never)]
580         public static readonly Color MediumSeaGreen = NDalic.MEDIUM_SEA_GREEN;
581
582         /// <summary>
583         /// Gets the medium_slate_blue colored Color class.
584         /// </summary>
585         [EditorBrowsable(EditorBrowsableState.Never)]
586         public static readonly Color MediumSlateBlue = NDalic.MEDIUM_SLATE_BLUE;
587
588         /// <summary>
589         /// Gets the medium_spring_green colored Color class.
590         /// </summary>
591         [EditorBrowsable(EditorBrowsableState.Never)]
592         public static readonly Color MediumSpringGreen = NDalic.MEDIUM_SPRING_GREEN;
593
594         /// <summary>
595         /// Gets the medium_turquoise colored Color class.
596         /// </summary>
597         [EditorBrowsable(EditorBrowsableState.Never)]
598         public static readonly Color MediumTurquoise = NDalic.MEDIUM_TURQUOISE;
599
600         /// <summary>
601         /// Gets the medium_violetred colored Color class.
602         /// </summary>
603         [EditorBrowsable(EditorBrowsableState.Never)]
604         public static readonly Color MediumVioletred = NDalic.MEDIUM_VIOLETRED;
605
606         /// <summary>
607         /// Gets the midnight_blue colored Color class.
608         /// </summary>
609         [EditorBrowsable(EditorBrowsableState.Never)]
610         public static readonly Color MidnightBlue = NDalic.MIDNIGHT_BLUE;
611
612         /// <summary>
613         /// Gets the mint_cream colored Color class.
614         /// </summary>
615         [EditorBrowsable(EditorBrowsableState.Never)]
616         public static readonly Color MintCream = NDalic.MINT_CREAM;
617
618         /// <summary>
619         /// Gets the misty_rose colored Color class.
620         /// </summary>
621         [EditorBrowsable(EditorBrowsableState.Never)]
622         public static readonly Color MistyRose = NDalic.MISTY_ROSE;
623
624         /// <summary>
625         /// Gets the moccasin colored Color class.
626         /// </summary>
627         [EditorBrowsable(EditorBrowsableState.Never)]
628         public static readonly Color Moccasin = NDalic.MOCCASIN;
629
630         /// <summary>
631         /// Gets the navajo_white colored Color class.
632         /// </summary>
633         [EditorBrowsable(EditorBrowsableState.Never)]
634         public static readonly Color NavajoWhite = NDalic.NAVAJO_WHITE;
635
636         /// <summary>
637         /// Gets the navy colored Color class.
638         /// </summary>
639         [EditorBrowsable(EditorBrowsableState.Never)]
640         public static readonly Color Navy = NDalic.NAVY;
641
642         /// <summary>
643         /// Gets the old_lace colored Color class.
644         /// </summary>
645         [EditorBrowsable(EditorBrowsableState.Never)]
646         public static readonly Color OldLace = NDalic.OLD_LACE;
647
648         /// <summary>
649         /// Gets the olive colored Color class.
650         /// </summary>
651         [EditorBrowsable(EditorBrowsableState.Never)]
652         public static readonly Color Olive = NDalic.OLIVE;
653
654         /// <summary>
655         /// Gets the olive_drab colored Color class.
656         /// </summary>
657         [EditorBrowsable(EditorBrowsableState.Never)]
658         public static readonly Color OliveDrab = NDalic.OLIVE_DRAB;
659
660         /// <summary>
661         /// Gets the orange colored Color class.
662         /// </summary>
663         [EditorBrowsable(EditorBrowsableState.Never)]
664         public static readonly Color Orange = NDalic.ORANGE;
665
666         /// <summary>
667         /// Gets the orange_red colored Color class.
668         /// </summary>
669         [EditorBrowsable(EditorBrowsableState.Never)]
670         public static readonly Color OrangeRed = NDalic.ORANGE_RED;
671
672         /// <summary>
673         /// Gets the orchid colored Color class.
674         /// </summary>
675         [EditorBrowsable(EditorBrowsableState.Never)]
676         public static readonly Color Orchid = NDalic.ORCHID;
677
678         /// <summary>
679         /// Gets the pale_golden_rod colored Color class.
680         /// </summary>
681         [EditorBrowsable(EditorBrowsableState.Never)]
682         public static readonly Color PaleGoldenRod = NDalic.PALE_GOLDEN_ROD;
683
684         /// <summary>
685         /// Gets the pale_green colored Color class.
686         /// </summary>
687         [EditorBrowsable(EditorBrowsableState.Never)]
688         public static readonly Color PaleGreen = NDalic.PALE_GREEN;
689
690         /// <summary>
691         /// Gets the  Pale_Turquoise colored Color class.
692         /// </summary>
693         [EditorBrowsable(EditorBrowsableState.Never)]
694         public static readonly Color PaleTurquoise = NDalic.PALE_TURQUOISE;
695
696         /// <summary>
697         /// Gets the Pale_Violet_Red colored Color class.
698         /// </summary>
699         [EditorBrowsable(EditorBrowsableState.Never)]
700         public static readonly Color PaleVioletRed = NDalic.PALE_VIOLET_RED;
701
702         /// <summary>
703         /// Gets the Papaya_whip  colored Color class.
704         /// </summary>
705         [EditorBrowsable(EditorBrowsableState.Never)]
706         public static readonly Color PapayaWhip = NDalic.PAPAYA_WHIP;
707
708         /// <summary>
709         /// Gets the Peach_puff colored Color class.
710         /// </summary>
711         [EditorBrowsable(EditorBrowsableState.Never)]
712         public static readonly Color PeachPuff = NDalic.PEACH_PUFF;
713
714         /// <summary>
715         /// Gets the peru colored Color class.
716         /// </summary>
717         [EditorBrowsable(EditorBrowsableState.Never)]
718         public static readonly Color Peru = NDalic.PERU;
719
720         /// <summary>
721         /// Gets the pink colored Color class.
722         /// </summary>
723         [EditorBrowsable(EditorBrowsableState.Never)]
724         public static readonly Color Pink = NDalic.PINK;
725
726         /// <summary>
727         /// Gets the plum colored Color class.
728         /// </summary>
729         [EditorBrowsable(EditorBrowsableState.Never)]
730         public static readonly Color Plum = NDalic.PLUM;
731
732         /// <summary>
733         /// Gets the powder_blue colored Color class.
734         /// </summary>
735         [EditorBrowsable(EditorBrowsableState.Never)]
736         public static readonly Color PowderBlue = NDalic.POWDER_BLUE;
737
738         /// <summary>
739         /// Gets the purple colored Color class.
740         /// </summary>
741         [EditorBrowsable(EditorBrowsableState.Never)]
742         public static readonly Color Purple = NDalic.PURPLE;
743
744         /// <summary>
745         /// Gets the red colored Color class.
746         /// </summary>
747         /// <since_tizen> 3 </since_tizen>
748         public static readonly Color Red = NDalic.RED;
749
750         /// <summary>
751         /// Gets the rosy_brown colored Color class.
752         /// </summary>
753         [EditorBrowsable(EditorBrowsableState.Never)]
754         public static readonly Color RosyBrown = NDalic.ROSY_BROWN;
755
756         /// <summary>
757         /// Gets the royal_blue colored Color class.
758         /// </summary>
759         [EditorBrowsable(EditorBrowsableState.Never)]
760         public static readonly Color RoyalBlue = NDalic.ROYAL_BLUE;
761
762         /// <summary>
763         /// Gets the saddle_brown colored Color class.
764         /// </summary>
765         [EditorBrowsable(EditorBrowsableState.Never)]
766         public static readonly Color SaddleBrown = NDalic.SADDLE_BROWN;
767
768         /// <summary>
769         /// Gets the salmon colored Color class.
770         /// </summary>
771         [EditorBrowsable(EditorBrowsableState.Never)]
772         public static readonly Color Salmon = NDalic.SALMON;
773
774         /// <summary>
775         /// Gets the sandy_brown colored Color class.
776         /// </summary>
777         [EditorBrowsable(EditorBrowsableState.Never)]
778         public static readonly Color SandyBrown = NDalic.SANDY_BROWN;
779
780         /// <summary>
781         /// Gets the sea_green colored Color class.
782         /// </summary>
783         [EditorBrowsable(EditorBrowsableState.Never)]
784         public static readonly Color SeaGreen = NDalic.SEA_GREEN;
785
786         /// <summary>
787         /// Gets the sea_shell colored Color class.
788         /// </summary>
789         [EditorBrowsable(EditorBrowsableState.Never)]
790         public static readonly Color SeaShell = NDalic.SEA_SHELL;
791
792         /// <summary>
793         /// Gets the sienna colored Color class.
794         /// </summary>
795         [EditorBrowsable(EditorBrowsableState.Never)]
796         public static readonly Color Sienna = NDalic.SIENNA;
797
798         /// <summary>
799         /// Gets the silver colored Color class.
800         /// </summary>
801         [EditorBrowsable(EditorBrowsableState.Never)]
802         public static readonly Color Silver = NDalic.SILVER;
803
804         /// <summary>
805         /// Gets the sky_blue colored Color class.
806         /// </summary>
807         [EditorBrowsable(EditorBrowsableState.Never)]
808         public static readonly Color SkyBlue = NDalic.SKY_BLUE;
809
810         /// <summary>
811         /// Gets the slate_blue colored Color class.
812         /// </summary>
813         [EditorBrowsable(EditorBrowsableState.Never)]
814         public static readonly Color SlateBlue = NDalic.SLATE_BLUE;
815
816         /// <summary>
817         /// Gets the slate_gray colored Color class.
818         /// </summary>
819         [EditorBrowsable(EditorBrowsableState.Never)]
820         public static readonly Color SlateGray = NDalic.SLATE_GRAY;
821
822         /// <summary>
823         /// Gets the slate_grey colored Color class.
824         /// </summary>
825         [EditorBrowsable(EditorBrowsableState.Never)]
826         public static readonly Color SlateGrey = NDalic.SLATE_GREY;
827
828         /// <summary>
829         /// Gets the snow colored Color class.
830         /// </summary>
831         [EditorBrowsable(EditorBrowsableState.Never)]
832         public static readonly Color Snow = NDalic.SNOW;
833
834         /// <summary>
835         /// Gets the spring_green colored Color class.
836         /// </summary>
837         [EditorBrowsable(EditorBrowsableState.Never)]
838         public static readonly Color SpringGreen = NDalic.SPRING_GREEN;
839
840         /// <summary>
841         /// Gets the steel_blue colored Color class.
842         /// </summary>
843         [EditorBrowsable(EditorBrowsableState.Never)]
844         public static readonly Color SteelBlue = NDalic.STEEL_BLUE;
845
846         /// <summary>
847         /// Gets the tan colored Color class.
848         /// </summary>
849         [EditorBrowsable(EditorBrowsableState.Never)]
850         public static readonly Color Tan = NDalic.TAN;
851
852         /// <summary>
853         /// Gets the teal colored Color class.
854         /// </summary>
855         [EditorBrowsable(EditorBrowsableState.Never)]
856         public static readonly Color Teal = NDalic.TEAL;
857
858         /// <summary>
859         /// Gets the thistle colored Color class.
860         /// </summary>
861         [EditorBrowsable(EditorBrowsableState.Never)]
862         public static readonly Color Thistle = NDalic.THISTLE;
863
864         /// <summary>
865         /// Gets the tomato colored Color class.
866         /// </summary>
867         [EditorBrowsable(EditorBrowsableState.Never)]
868         public static readonly Color Tomato = NDalic.TOMATO;
869
870         /// <summary>
871         /// Gets the  transparent colored Color class.
872         /// </summary>
873         /// <since_tizen> 3 </since_tizen>
874         public static readonly Color Transparent = NDalic.TRANSPARENT;
875
876         /// <summary>
877         /// Gets the turquoise colored Color class.
878         /// </summary>
879         [EditorBrowsable(EditorBrowsableState.Never)]
880         public static readonly Color Turquoise = NDalic.TURQUOISE;
881
882         /// <summary>
883         /// Gets the violet colored Color class.
884         /// </summary>
885         [EditorBrowsable(EditorBrowsableState.Never)]
886         public static readonly Color Violet = NDalic.VIOLET;
887
888         /// <summary>
889         /// Gets the wheat colored Color class.
890         /// </summary>
891         [EditorBrowsable(EditorBrowsableState.Never)]
892         public static readonly Color Wheat = NDalic.WHEAT;
893
894         /// <summary>
895         /// Gets the white colored Color class.
896         /// </summary>
897         /// <since_tizen> 3 </since_tizen>
898         public static readonly Color White = NDalic.WHITE;
899
900         /// <summary>
901         /// Gets the white_smoke colored Color class.
902         /// </summary>
903         [EditorBrowsable(EditorBrowsableState.Never)]
904         public static readonly Color WhiteSmoke = NDalic.WHITE_SMOKE;
905
906         /// <summary>
907         /// Gets the yellow colored Color class.
908         /// </summary>
909         /// <since_tizen> 3 </since_tizen>
910         public static readonly Color Yellow = NDalic.YELLOW;
911
912         /// <summary>
913         /// Gets the yellow_green colored Color class.
914         /// </summary>
915         [EditorBrowsable(EditorBrowsableState.Never)]
916         public static readonly Color YellowGreen = NDalic.YELLOW_GREEN;
917
918
919         private readonly bool hashDummy;
920
921         /// <summary>
922         /// Default constructor
923         /// </summary>
924         /// <since_tizen> 3 </since_tizen>
925         public Color() : this(Interop.Vector4.NewVector4(), true)
926         {
927             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
928         }
929
930
931         /// <summary>
932         /// The constructor.
933         /// </summary>
934         /// <param name="r">The red component.</param>
935         /// <param name="g">The green component.</param>
936         /// <param name="b">The blue component.</param>
937         /// <param name="a">The alpha component.</param>
938         /// <since_tizen> 3 </since_tizen>
939         public Color(float r, float g, float b, float a) : this(Interop.Vector4.NewVector4(ValueCheck(r), ValueCheck(g), ValueCheck(b), ValueCheck(a)), true)
940         {
941             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
942         }
943
944         /// <summary>
945         /// The conversion constructor from an array of four floats.
946         /// </summary>
947         /// <param name="array">array Array of R,G,B,A.</param>
948         /// <since_tizen> 3 </since_tizen>
949         public Color(float[] array) : this(Interop.Vector4.NewVector4(ValueCheck(array)), true)
950         {
951             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
952         }
953
954         /// <summary>
955         /// The conversion constructor from text color representation.
956         /// hexcode representation : #RGB #RGBA #RRGGBB #RRGGBBAA
957         /// rgb representation : rgb(0-255,0-255,0-255) rgba(0-255,0-255,0-255,0.0-1.0)
958         /// </summary>
959         /// <param name="textColor">color text representation as Hexcode, rgb() or rgba()</param>
960         /// <exception cref="ArgumentNullException">This exception is thrown when hexColor is null.</exception>
961         /// <since_tizen> 6 </since_tizen>
962         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
963         [EditorBrowsable(EditorBrowsableState.Never)]
964         public Color(string textColor) : this(Interop.Vector4.NewVector4(), true)
965         {
966             try
967             {
968                 if (null == textColor)
969                 {
970                     throw new ArgumentNullException(nameof(textColor));
971                 }
972
973                 textColor = textColor.ToUpperInvariant();
974                 textColor = textColor.Replace(" ", "");
975
976                 if (textColor.Length > 0 && textColor[0] == '#')
977                 {
978                     textColor = textColor.Replace("#", "");
979                     int textColorLength = textColor.Length;
980
981                     if (textColorLength == 6 || textColorLength == 8) /* #RRGGBB or #RRGGBBAA */
982                     {
983                         R = ((float)Convert.ToInt32(textColor.Substring(0, 2), 16)) / 255.0f;
984                         G = ((float)Convert.ToInt32(textColor.Substring(2, 2), 16)) / 255.0f;
985                         B = ((float)Convert.ToInt32(textColor.Substring(4, 2), 16)) / 255.0f;
986                         A = textColor.Length > 6 ? ((float)Convert.ToInt32(textColor.Substring(6, 2), 16)) / 255.0f : 1.0f;
987                     }
988                     else if (textColorLength == 3 || textColorLength == 4) /* #RGB */
989                     {
990                         R = ((float)Convert.ToInt32(textColor.Substring(0, 1), 16)) / 15.0f;
991                         G = ((float)Convert.ToInt32(textColor.Substring(1, 1), 16)) / 15.0f;
992                         B = ((float)Convert.ToInt32(textColor.Substring(2, 1), 16)) / 15.0f;
993                         A = textColor.Length > 3 ? ((float)Convert.ToInt32(textColor.Substring(3, 1), 16)) / 15.0f : 1.0f;
994                     }
995                     else
996                     {
997                         throw new global::System.ArgumentException("Please check your color text code");
998                     }
999                 }
1000                 else // example rgb(255,255,255) or rgb(255,255,255,1.0)
1001                 {
1002                     bool isRGBA = textColor.StartsWith("RGBA(");
1003                     bool isRGB = textColor.StartsWith("RGB(");
1004
1005                     if (!isRGBA && !isRGB)
1006                     {
1007                         throw new global::System.ArgumentException("Please check your color text code");
1008                     }
1009
1010                     if (isRGBA)
1011                         textColor = textColor.Substring(4);
1012                     if (isRGB)
1013                         textColor = textColor.Substring(3);
1014
1015                     textColor = textColor.Replace(")", "");
1016                     textColor = textColor.Replace("(", "");
1017
1018                     string[] components = textColor.Split(',');
1019
1020                     if (components.Length == 3 && isRGB)
1021                     {
1022                         R = Math.Min(1.0f, ((float)Convert.ToInt32(components[0], 10)) / 255.0f);
1023                         G = Math.Min(1.0f, ((float)Convert.ToInt32(components[1], 10)) / 255.0f);
1024                         B = Math.Min(1.0f, ((float)Convert.ToInt32(components[2], 10)) / 255.0f);
1025                         A = 1.0f;
1026                     }
1027                     else if (components.Length == 4 && isRGBA)
1028                     {
1029                         R = Math.Min(1.0f, ((float)Convert.ToInt32(components[0], 10)) / 255.0f);
1030                         G = Math.Min(1.0f, ((float)Convert.ToInt32(components[1], 10)) / 255.0f);
1031                         B = Math.Min(1.0f, ((float)Convert.ToInt32(components[2], 10)) / 255.0f);
1032                         A = Math.Min(1.0f, float.Parse(components[3]));
1033                     }
1034                 }
1035             }
1036             catch
1037             {
1038                 throw new global::System.ArgumentException("Please check your color text code");
1039             }
1040         }
1041
1042         /// <summary>
1043         /// The conversion constructor from an System.Drawing.Color instance.
1044         /// </summary>
1045         /// <param name="color">System.Drawing.Color instance</param>
1046         [EditorBrowsable(EditorBrowsableState.Never)]
1047         public Color(global::System.Drawing.Color color) : this(Interop.Vector4.NewVector4(), true)
1048         {
1049             R = color.R / 255.0f;
1050             G = color.G / 255.0f;
1051             B = color.B / 255.0f;
1052             A = color.A / 255.0f;
1053         }
1054
1055         /// <summary>
1056         /// The copy constructor.
1057         /// </summary>
1058         /// <param name="other">The copy target.</param>
1059         /// <exception cref="ArgumentNullException"> Thrown when other is null. </exception>
1060         [EditorBrowsable(EditorBrowsableState.Never)]
1061         public Color(Color other) : this(other == null ? throw new ArgumentNullException(nameof(other)) : other.R, other.G, other.B, other.A)
1062         {
1063         }
1064
1065         internal Color(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
1066         {
1067             hashDummy = false;
1068         }
1069
1070         internal Color(ColorChangedCallback cb, float r, float g, float b, float a) : this(Interop.Vector4.NewVector4(ValueCheck(r), ValueCheck(g), ValueCheck(b), ValueCheck(a)), true)
1071         {
1072             callback = cb;
1073             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1074         }
1075
1076         internal Color(ColorChangedCallback cb, Color other) : this(cb, other.R, other.G, other.B, other.A)
1077         {
1078         }
1079
1080         internal delegate void ColorChangedCallback(float r, float g, float b, float a);
1081         private ColorChangedCallback callback = null;
1082
1083         /// <summary>
1084         /// The red component.
1085         /// </summary>
1086         /// <remarks>
1087         /// The setter is deprecated in API8 and will be removed in API10. Please use new Color(...) constructor.
1088         /// </remarks>
1089         /// <code>
1090         /// // DO NOT use like the followings!
1091         /// Color color = new Color();
1092         /// color.R = 0.1f; 
1093         /// // Please USE like this
1094         /// float r = 0.1f, g = 0.5f, b = 0.9f, a = 1.0f;
1095         /// Color color = new Color(r, g, b, a);
1096         /// </code>
1097         /// <since_tizen> 3 </since_tizen>
1098         public float R
1099         {
1100             set
1101             {
1102                 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Color(...) constructor");
1103                 Interop.Vector4.RSet(SwigCPtr, ValueCheck(value));
1104                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1105
1106                 callback?.Invoke(R, G, B, A);
1107             }
1108             get
1109             {
1110                 float ret = Interop.Vector4.RGet(SwigCPtr);
1111                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1112                 return ret;
1113             }
1114         }
1115
1116         /// <summary>
1117         /// The green component.
1118         /// </summary>
1119         /// <remarks>
1120         /// The setter is deprecated in API8 and will be removed in API10. Please use new Color(...) constructor.
1121         /// </remarks>
1122         /// <code>
1123         /// // DO NOT use like the followings!
1124         /// Color color = new Color();
1125         /// color.G = 0.5f; 
1126         /// // Please USE like this
1127         /// float r = 0.1f, g = 0.5f, b = 0.9f, a = 1.0f;
1128         /// Color color = new Color(r, g, b, a);
1129         /// </code>
1130         /// <since_tizen> 3 </since_tizen>
1131         public float G
1132         {
1133             set
1134             {
1135                 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Color(...) constructor");
1136                 Interop.Vector4.GSet(SwigCPtr, ValueCheck(value));
1137                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1138
1139                 callback?.Invoke(R, G, B, A);
1140             }
1141             get
1142             {
1143                 float ret = Interop.Vector4.GGet(SwigCPtr);
1144                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1145                 return ret;
1146             }
1147         }
1148
1149         /// <summary>
1150         /// The blue component.
1151         /// </summary>
1152         /// <remarks>
1153         /// The setter is deprecated in API8 and will be removed in API10. Please use new Color(...) constructor.
1154         /// </remarks>
1155         /// <code>
1156         /// // DO NOT use like the followings!
1157         /// Color color = new Color();
1158         /// color.B = 0.9f; 
1159         /// // Please USE like this
1160         /// float r = 0.1f, g = 0.5f, b = 0.9f, a = 1.0f;
1161         /// Color color = new Color(r, g, b, a);
1162         /// </code>
1163         /// <since_tizen> 3 </since_tizen>
1164         public float B
1165         {
1166             set
1167             {
1168                 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Color(...) constructor");
1169                 Interop.Vector4.BSet(SwigCPtr, ValueCheck(value));
1170                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1171
1172                 callback?.Invoke(R, G, B, A);
1173             }
1174             get
1175             {
1176                 float ret = Interop.Vector4.BGet(SwigCPtr);
1177                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1178                 return ret;
1179             }
1180         }
1181
1182         /// <summary>
1183         /// The alpha component.
1184         /// </summary>
1185         /// <remarks>
1186         /// The setter is deprecated in API8 and will be removed in API10. Please use new Color(...) constructor.
1187         /// </remarks>
1188         /// <code>
1189         /// // DO NOT use like the followings!
1190         /// Color color = new Color();
1191         /// color.A = 1.0f; 
1192         /// // Please USE like this
1193         /// float r = 0.1f, g = 0.5f, b = 0.9f, a = 1.0f;
1194         /// Color color = new Color(r, g, b, a);
1195         /// </code>
1196         /// <since_tizen> 3 </since_tizen>
1197         public float A
1198         {
1199             set
1200             {
1201                 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Color(...) constructor");
1202                 Interop.Vector4.ASet(SwigCPtr, ValueCheck(value));
1203                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1204
1205                 callback?.Invoke(R, G, B, A);
1206             }
1207             get
1208             {
1209                 float ret = Interop.Vector4.AGet(SwigCPtr);
1210                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1211                 return ret;
1212             }
1213         }
1214
1215         /// <summary>
1216         /// The array subscript operator overload.
1217         /// </summary>
1218         /// <param name="index">The subscript index.</param>
1219         /// <returns>The float at the given index.</returns>
1220         /// <since_tizen> 3 </since_tizen>
1221         public float this[uint index]
1222         {
1223             get
1224             {
1225                 return ValueOfIndex(index);
1226             }
1227         }
1228
1229         /// <summary>
1230         /// Converts the Color class to Vector4 class implicitly.
1231         /// </summary>
1232         /// <param name="color">A color to be converted to Vector4</param>
1233         /// <since_tizen> 3 </since_tizen>
1234         public static implicit operator Vector4(Color color)
1235         {
1236             if (color == null)
1237             {
1238                 return null;
1239             }
1240             return new Vector4(color.R, color.G, color.B, color.A);
1241         }
1242
1243         /// <summary>
1244         /// Converts Vector4 class to Color class implicitly.
1245         /// </summary>
1246         /// <param name="vec">A Vector4 to be converted to color.</param>
1247         /// <since_tizen> 3 </since_tizen>
1248         public static implicit operator Color(Vector4 vec)
1249         {
1250             if (vec == null)
1251             {
1252                 return null;
1253             }
1254             return new Color(vec.R, vec.G, vec.B, vec.A);
1255         }
1256
1257         /// <summary>
1258         /// The addition operator.
1259         /// </summary>
1260         /// <param name="arg1">The first value.</param>
1261         /// <param name="arg2">The second value.</param>
1262         /// <returns>The color containing the result of the addition.</returns>
1263         /// <exception cref="ArgumentNullException"> Thrown when arg1 is null. </exception>
1264         /// <since_tizen> 3 </since_tizen>
1265         public static Color operator +(Color arg1, Color arg2)
1266         {
1267             if (null == arg1)
1268             {
1269                 throw new ArgumentNullException(nameof(arg1));
1270             }
1271             Color result = arg1.Add(arg2);
1272             return ValueCheck(result);
1273         }
1274
1275         /// <summary>
1276         /// The subtraction operator.
1277         /// </summary>
1278         /// <param name="arg1">The first value.</param>
1279         /// <param name="arg2">The second value.</param>
1280         /// <returns>The color containing the result of the subtraction.</returns>
1281         /// <exception cref="ArgumentNullException"> Thrown when arg1 is null. </exception>
1282         /// <since_tizen> 3 </since_tizen>
1283         public static Color operator -(Color arg1, Color arg2)
1284         {
1285             if (null == arg1)
1286             {
1287                 throw new ArgumentNullException(nameof(arg1));
1288             }
1289             Color result = arg1.Subtract(arg2);
1290             return ValueCheck(result);
1291         }
1292
1293         /// <summary>
1294         /// The unary negation operator.
1295         /// </summary>
1296         /// <param name="arg1">The target value.</param>
1297         /// <returns>The color containg the negation.</returns>
1298         /// <exception cref="ArgumentNullException"> Thrown when arg1 is null. </exception>
1299         /// <since_tizen> 3 </since_tizen>
1300         public static Color operator -(Color arg1)
1301         {
1302             if (null == arg1)
1303             {
1304                 throw new ArgumentNullException(nameof(arg1));
1305             }
1306             Color result = arg1.Subtract();
1307             return ValueCheck(result);
1308         }
1309
1310         /// <summary>
1311         /// The multiplication operator.
1312         /// </summary>
1313         /// <param name="arg1">The first value.</param>
1314         /// <param name="arg2">The second value.</param>
1315         /// <returns>The color containing the result of the multiplication.</returns>
1316         /// <exception cref="ArgumentNullException"> Thrown when arg1 is null. </exception>
1317         /// <since_tizen> 3 </since_tizen>
1318         public static Color operator *(Color arg1, Color arg2)
1319         {
1320             if (null == arg1)
1321             {
1322                 throw new ArgumentNullException(nameof(arg1));
1323             }
1324             Color result = arg1.Multiply(arg2);
1325             return ValueCheck(result);
1326         }
1327
1328         /// <summary>
1329         /// The multiplication operator.
1330         /// </summary>
1331         /// <param name="arg1">The first value.</param>
1332         /// <param name="arg2">The second value.</param>
1333         /// <returns>The color containing the result of the multiplication.</returns>
1334         /// <exception cref="ArgumentNullException"> Thrown when arg1 is null. </exception>
1335         /// <since_tizen> 3 </since_tizen>
1336         public static Color operator *(Color arg1, float arg2)
1337         {
1338             if (null == arg1)
1339             {
1340                 throw new ArgumentNullException(nameof(arg1));
1341             }
1342             Color result = arg1.Multiply(arg2);
1343             return ValueCheck(result);
1344         }
1345
1346         /// <summary>
1347         /// The division operator.
1348         /// </summary>
1349         /// <param name="arg1">The first value.</param>
1350         /// <param name="arg2">The second value.</param>
1351         /// <returns>The color containing the result of the division.</returns>
1352         /// <exception cref="ArgumentNullException"> Thrown when arg1 is null. </exception>
1353         /// <since_tizen> 3 </since_tizen>
1354         public static Color operator /(Color arg1, Color arg2)
1355         {
1356             if (null == arg1)
1357             {
1358                 throw new ArgumentNullException(nameof(arg1));
1359             }
1360             Color result = arg1.Divide(arg2);
1361             return ValueCheck(result);
1362         }
1363
1364         /// <summary>
1365         /// The division operator.
1366         /// </summary>
1367         /// <param name="arg1">The first value.</param>
1368         /// <param name="arg2">The second value.</param>
1369         /// <returns>The color containing the result of the division.</returns>
1370         /// <exception cref="ArgumentNullException"> Thrown when arg1 is null. </exception>
1371         /// <since_tizen> 3 </since_tizen>
1372         public static Color operator /(Color arg1, float arg2)
1373         {
1374             if (null == arg1)
1375             {
1376                 throw new ArgumentNullException(nameof(arg1));
1377             }
1378             Color result = arg1.Divide(arg2);
1379             return ValueCheck(result);
1380         }
1381
1382         /// <summary>
1383         /// Checks if two color classes are same.
1384         /// </summary>
1385         /// <param name="rhs">A color to be compared.</param>
1386         /// <returns>If two colors are are same, then true.</returns>
1387         /// <since_tizen> 3 </since_tizen>
1388         public bool EqualTo(Color rhs)
1389         {
1390             bool ret = Interop.Vector4.EqualTo(SwigCPtr, Color.getCPtr(rhs));
1391
1392             if (rhs == null) return false;
1393
1394             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1395             return ret;
1396         }
1397
1398         /// <summary>
1399         /// Checks if two color classes are different.
1400         /// </summary>
1401         /// <param name="rhs">A color to be compared.</param>
1402         /// <returns>If two colors are are different, then true.</returns>
1403         /// <since_tizen> 3 </since_tizen>
1404         public bool NotEqualTo(Color rhs)
1405         {
1406             bool ret = Interop.Vector4.NotEqualTo(SwigCPtr, Color.getCPtr(rhs));
1407             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1408             return ret;
1409         }
1410
1411         /// <inheritdoc/>
1412         [EditorBrowsable(EditorBrowsableState.Never)]
1413         public object Clone() => new Color(this);
1414
1415         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Color obj)
1416         {
1417             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
1418         }
1419
1420         internal static Color GetColorFromPtr(global::System.IntPtr cPtr)
1421         {
1422             Color ret = new Color(cPtr, false);
1423             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1424             return ret;
1425         }
1426
1427         internal static Color ValueCheck(Color color)
1428         {
1429             float r = color.R;
1430             float g = color.G;
1431             float b = color.B;
1432             float a = color.A;
1433
1434             if (IsInvalidValue(ref r) | IsInvalidValue(ref g) | IsInvalidValue(ref b) | IsInvalidValue(ref a))
1435             {
1436                 NUILog.Error($"The value of Result is invalid! Should be between [0, 1]. Color is {color.R}, {color.G}, {color.B}, {color.A}");
1437             }
1438             color = new Color(r, g, b, a);
1439             return color;
1440         }
1441
1442         internal static float ValueCheck(float value)
1443         {
1444             float refValue = value;
1445             if (IsInvalidValue(ref refValue))
1446             {
1447                 NUILog.Error($"The value of Result is invalid! Should be between [0, 1]. float value is {value}");
1448             }
1449             return refValue;
1450         }
1451
1452         internal static float[] ValueCheck(float[] arr)
1453         {
1454             if (null == arr)
1455             {
1456                 throw new ArgumentNullException(nameof(arr));
1457             }
1458
1459             for (int i = 0; i < arr.Length; i++)
1460             {
1461                 float refValue = arr[i];
1462                 if (IsInvalidValue(ref refValue))
1463                 {
1464                     NUILog.Error($"The value of Result is invalid! Should be between [0, 1]. arr[] is {arr[i]}");
1465                     arr[i] = refValue;
1466                 }
1467             }
1468             return arr;
1469         }
1470
1471         private static bool IsInvalidValue(ref float value)
1472         {
1473             if (value < 0.0f)
1474             {
1475                 value = 0.0f;
1476                 return true;
1477             }
1478             else if (value > 1.0f)
1479             {
1480                 value = 1.0f;
1481                 return true;
1482             }
1483             return false;
1484         }
1485
1486         /// This will not be public opened.
1487         [EditorBrowsable(EditorBrowsableState.Never)]
1488         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1489         {
1490             Interop.Vector4.DeleteVector4(swigCPtr);
1491         }
1492
1493         private Color Add(Color rhs)
1494         {
1495             Color ret = new Color(Interop.Vector4.Add(SwigCPtr, Color.getCPtr(rhs)), true);
1496             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1497             return ret;
1498         }
1499
1500         private Color AddAssign(Vector4 rhs)
1501         {
1502             Color ret = new Color(Interop.Vector4.AddAssign(SwigCPtr, Color.getCPtr(rhs)), false);
1503             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1504             return ret;
1505         }
1506
1507         private Color Subtract(Color rhs)
1508         {
1509             Color ret = new Color(Interop.Vector4.Subtract(SwigCPtr, Color.getCPtr(rhs)), true);
1510             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1511             return ret;
1512         }
1513
1514         private Color SubtractAssign(Color rhs)
1515         {
1516             Color ret = new Color(Interop.Vector4.SubtractAssign(SwigCPtr, Color.getCPtr(rhs)), false);
1517             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1518             return ret;
1519         }
1520
1521         private Color Multiply(Color rhs)
1522         {
1523             Color ret = new Color(Interop.Vector4.Multiply(SwigCPtr, Color.getCPtr(rhs)), true);
1524             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1525             return ret;
1526         }
1527
1528         private Color Multiply(float rhs)
1529         {
1530             Color ret = new Color(Interop.Vector4.Multiply(SwigCPtr, rhs), true);
1531             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1532             return ret;
1533         }
1534
1535         private Color MultiplyAssign(Color rhs)
1536         {
1537             Color ret = new Color(Interop.Vector4.MultiplyAssign(SwigCPtr, Color.getCPtr(rhs)), false);
1538             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1539             return ret;
1540         }
1541
1542         private Color MultiplyAssign(float rhs)
1543         {
1544             Color ret = new Color(Interop.Vector4.MultiplyAssign(SwigCPtr, rhs), false);
1545             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1546             return ret;
1547         }
1548
1549         private Color Divide(Vector4 rhs)
1550         {
1551             Color ret = new Color(Interop.Vector4.Divide(SwigCPtr, Color.getCPtr(rhs)), true);
1552             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1553             return ret;
1554         }
1555
1556         private Color Divide(float rhs)
1557         {
1558             Color ret = new Color(Interop.Vector4.Divide(SwigCPtr, rhs), true);
1559             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1560             return ret;
1561         }
1562
1563         private Color DivideAssign(Color rhs)
1564         {
1565             Color ret = new Color(Interop.Vector4.DivideAssign(SwigCPtr, Color.getCPtr(rhs)), false);
1566             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1567             return ret;
1568         }
1569
1570         private Color DivideAssign(float rhs)
1571         {
1572             Color ret = new Color(Interop.Vector4.DivideAssign(SwigCPtr, rhs), false);
1573             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1574             return ret;
1575         }
1576
1577         private Color Subtract()
1578         {
1579             Color ret = new Color(Interop.Vector4.Subtract(SwigCPtr), true);
1580             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1581             return ret;
1582         }
1583
1584         private static bool EqualsColorValue(float f1, float f2)
1585         {
1586             float EPS = (float)Math.Abs(f1 * .00001);
1587             if (Math.Abs(f1 - f2) <= EPS)
1588             {
1589                 return true;
1590             }
1591             else
1592             {
1593                 return false;
1594             }
1595         }
1596
1597         private static bool EqualsColor(Color c1, Color c2)
1598         {
1599             return EqualsColorValue(c1.R, c2.R) && EqualsColorValue(c1.G, c2.G)
1600                 && EqualsColorValue(c1.B, c2.B) && EqualsColorValue(c1.A, c2.A);
1601         }
1602
1603         /// <summary>
1604         /// Determines whether the specified object is equal to the current object.
1605         /// </summary>
1606         /// <param name="obj">The object to compare with the current object.</param>
1607         /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
1608         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
1609         [EditorBrowsable(EditorBrowsableState.Never)]
1610         public override bool Equals(System.Object obj)
1611         {
1612             Color color = obj as Color;
1613             bool equal = false;
1614             if (color == null)
1615             {
1616                 return equal;
1617             }
1618
1619             if (EqualsColor(this, color))
1620             {
1621                 equal = true;
1622             }
1623             return equal;
1624         }
1625
1626         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
1627         [EditorBrowsable(EditorBrowsableState.Never)]
1628         public override int GetHashCode()
1629         {
1630             return hashDummy.GetHashCode();
1631         }
1632
1633         private float ValueOfIndex(uint index)
1634         {
1635             float ret = Interop.Vector4.ValueOfIndex(SwigCPtr, index);
1636             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1637             return ret;
1638         }
1639
1640     }
1641
1642 }
1643
1644