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