[NUI] Refactoring Theme and StyleManager (#1981)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Color.cs
1 /*
2  * Copyright(c) 2019 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
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 black colored Color class.
33         /// </summary>
34         /// <since_tizen> 3 </since_tizen>
35         public static readonly Color Black = new Color(0.0f, 0.0f, 0.0f, 1.0f);
36
37         /// <summary>
38         /// Gets the white colored Color class.
39         /// </summary>
40         /// <since_tizen> 3 </since_tizen>
41         public static readonly Color White = new Color(1.0f, 1.0f, 1.0f, 1.0f);
42
43         /// <summary>
44         /// Gets the red colored Color class.
45         /// </summary>
46         /// <since_tizen> 3 </since_tizen>
47         public static readonly Color Red = new Color(1.0f, 0.0f, 0.0f, 1.0f);
48
49         /// <summary>
50         /// Gets the green colored Color class.
51         /// </summary>
52         /// <since_tizen> 3 </since_tizen>
53         public static readonly Color Green = new Color(0.0f, 1.0f, 0.0f, 1.0f);
54
55         /// <summary>
56         /// Gets the blue colored Color class.
57         /// </summary>
58         /// <since_tizen> 3 </since_tizen>
59         public static readonly Color Blue = new Color(0.0f, 0.0f, 1.0f, 1.0f);
60
61         /// <summary>
62         /// Gets the yellow colored Color class.
63         /// </summary>
64         /// <since_tizen> 3 </since_tizen>
65         public static readonly Color Yellow = new Color(1.0f, 1.0f, 0.0f, 1.0f);
66
67         /// <summary>
68         /// Gets the magenta colored Color class.
69         /// </summary>
70         /// <since_tizen> 3 </since_tizen>
71         public static readonly Color Magenta = new Color(1.0f, 0.0f, 1.0f, 1.0f);
72
73         /// <summary>
74         /// Gets the cyan colored Color class.
75         /// </summary>
76         /// <since_tizen> 3 </since_tizen>
77         public static readonly Color Cyan = new Color(0.0f, 1.0f, 1.0f, 1.0f);
78
79         /// <summary>
80         /// Gets the  transparent colored Color class.
81         /// </summary>
82         /// <since_tizen> 3 </since_tizen>
83         public static readonly Color Transparent = new Color(0.0f, 0.0f, 0.0f, 0.0f);
84
85         private readonly bool hashDummy;
86
87         /// <summary>
88         /// Default constructor
89         /// </summary>
90         /// <since_tizen> 3 </since_tizen>
91         public Color() : this(Interop.Vector4.new_Vector4__SWIG_0(), true)
92         {
93             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
94         }
95
96
97         /// <summary>
98         /// The constructor.
99         /// </summary>
100         /// <param name="r">The red component.</param>
101         /// <param name="g">The green component.</param>
102         /// <param name="b">The blue component.</param>
103         /// <param name="a">The alpha component.</param>
104         /// <since_tizen> 3 </since_tizen>
105         public Color(float r, float g, float b, float a) : this(Interop.Vector4.new_Vector4__SWIG_1(ValueCheck(r), ValueCheck(g), ValueCheck(b), ValueCheck(a)), true)
106         {
107             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
108         }
109
110         /// <summary>
111         /// The conversion constructor from an array of four floats.
112         /// </summary>
113         /// <param name="array">array Array of R,G,B,A.</param>
114         /// <since_tizen> 3 </since_tizen>
115         public Color(float[] array) : this(Interop.Vector4.new_Vector4__SWIG_2(ValueCheck(array)), true)
116         {
117             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
118         }
119
120         /// <summary>
121         /// The conversion constructor from an hexcode of four floats.
122         /// </summary>
123         /// <param name="hexColor">Hex color code</param>
124         /// <since_tizen> 6 </since_tizen>
125         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
126         [EditorBrowsable(EditorBrowsableState.Never)]
127         public Color(string hexColor) : this(Interop.Vector4.new_Vector4__SWIG_0(), true)
128         {
129             try
130             {
131                 hexColor = hexColor.Replace("#", "");
132                 
133                 R = ((float)Convert.ToInt32(hexColor.Substring(0,2), 16))/255.0f;
134                 G = ((float)Convert.ToInt32(hexColor.Substring(2,2), 16))/255.0f;
135                 B = ((float)Convert.ToInt32(hexColor.Substring(4,2), 16))/255.0f;
136                 A = hexColor.Length > 6 ? ((float)Convert.ToInt32(hexColor.Substring(6,2), 16))/255.0f : 1.0f;
137             }
138             catch
139             {
140                 throw new global::System.ArgumentException("Please check your hex code");
141             }
142         }
143
144         /// <summary>
145         /// The conversion constructor from an System.Drawing.Color instance.
146         /// </summary>
147         /// <param name="color">System.Drawing.Color instance</param>
148         [EditorBrowsable(EditorBrowsableState.Never)]
149         public Color(global::System.Drawing.Color color) : this(Interop.Vector4.new_Vector4__SWIG_0(), true)
150         {
151             R = color.R / 255.0f;
152             G = color.G / 255.0f;
153             B = color.B / 255.0f;
154             A = color.A / 255.0f;
155         }
156
157         /// <summary>
158         /// The copy constructor.
159         /// </summary>
160         /// <param name="other">The copy target.</param>
161         [EditorBrowsable(EditorBrowsableState.Never)]
162         public Color(Color other) : this(other.R, other.G, other.B, other.A)
163         {
164         }
165
166         internal Color(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
167         {
168                         hashDummy = false;
169         }
170
171         internal Color(ColorChangedCallback cb, float r, float g, float b, float a) : this(Interop.Vector4.new_Vector4__SWIG_1(ValueCheck(r), ValueCheck(g), ValueCheck(b), ValueCheck(a)), true)
172         {
173             callback = cb;
174             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175         }
176
177         internal Color(ColorChangedCallback cb, Color other) : this(cb, other.R, other.G, other.B, other.A)
178         {
179         }
180
181         internal delegate void ColorChangedCallback(float r, float g, float b, float a);
182         private ColorChangedCallback callback = null;
183
184         /// <summary>
185         /// The red component.
186         /// </summary>
187         /// <since_tizen> 3 </since_tizen>
188         public float R
189         {
190             set
191             {
192                 Interop.Vector4.Vector4_r_set(swigCPtr, ValueCheck(value));
193                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194
195                 callback?.Invoke(R, G, B, A);
196             }
197             get
198             {
199                 float ret = Interop.Vector4.Vector4_r_get(swigCPtr);
200                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
201                 return ret;
202             }
203         }
204
205         /// <summary>
206         /// The green component.
207         /// </summary>
208         /// <since_tizen> 3 </since_tizen>
209         public float G
210         {
211             set
212             {
213                 Interop.Vector4.Vector4_g_set(swigCPtr, ValueCheck(value));
214                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215
216                 callback?.Invoke(R, G, B, A);
217             }
218             get
219             {
220                 float ret = Interop.Vector4.Vector4_g_get(swigCPtr);
221                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222                 return ret;
223             }
224         }
225
226         /// <summary>
227         /// The blue component.
228         /// </summary>
229         /// <since_tizen> 3 </since_tizen>
230         public float B
231         {
232             set
233             {
234                 Interop.Vector4.Vector4_b_set(swigCPtr, ValueCheck(value));
235                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236
237                 callback?.Invoke(R, G, B, A);
238             }
239             get
240             {
241                 float ret = Interop.Vector4.Vector4_b_get(swigCPtr);
242                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243                 return ret;
244             }
245         }
246
247         /// <summary>
248         /// The alpha component.
249         /// </summary>
250         /// <since_tizen> 3 </since_tizen>
251         public float A
252         {
253             set
254             {
255                 Interop.Vector4.Vector4_a_set(swigCPtr, ValueCheck(value));
256                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
257
258                 callback?.Invoke(R, G, B, A);
259             }
260             get
261             {
262                 float ret = Interop.Vector4.Vector4_a_get(swigCPtr);
263                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
264                 return ret;
265             }
266         }
267
268         /// <summary>
269         /// The array subscript operator overload.
270         /// </summary>
271         /// <param name="index">The subscript index.</param>
272         /// <returns>The float at the given index.</returns>
273         /// <since_tizen> 3 </since_tizen>
274         public float this[uint index]
275         {
276             get
277             {
278                 return ValueOfIndex(index);
279             }
280         }
281
282         /// <summary>
283         /// Converts the Color class to Vector4 class implicitly.
284         /// </summary>
285         /// <param name="color">A color to be converted to Vector4</param>
286         /// <since_tizen> 3 </since_tizen>
287         public static implicit operator Vector4(Color color)
288         {
289             return new Vector4(color.R, color.G, color.B, color.A);
290         }
291
292         /// <summary>
293         /// Converts Vector4 class to Color class implicitly.
294         /// </summary>
295         /// <param name="vec">A Vector4 to be converted to color.</param>
296         /// <since_tizen> 3 </since_tizen>
297         public static implicit operator Color(Vector4 vec)
298         {
299             return new Color(vec.R, vec.G, vec.B, vec.A);
300         }
301
302         /// <summary>
303         /// The addition operator.
304         /// </summary>
305         /// <param name="arg1">The first value.</param>
306         /// <param name="arg2">The second value.</param>
307         /// <returns>The color containing the result of the addition.</returns>
308         /// <since_tizen> 3 </since_tizen>
309         public static Color operator +(Color arg1, Color arg2)
310         {
311             Color result = arg1.Add(arg2);
312             return ValueCheck(result);
313         }
314
315         /// <summary>
316         /// The subtraction operator.
317         /// </summary>
318         /// <param name="arg1">The first value.</param>
319         /// <param name="arg2">The second value.</param>
320         /// <returns>The color containing the result of the subtraction.</returns>
321         /// <since_tizen> 3 </since_tizen>
322         public static Color operator -(Color arg1, Color arg2)
323         {
324             Color result = arg1.Subtract(arg2);
325             return ValueCheck(result);
326         }
327
328         /// <summary>
329         /// The unary negation operator.
330         /// </summary>
331         /// <param name="arg1">The target value.</param>
332         /// <returns>The color containg the negation.</returns>
333         /// <since_tizen> 3 </since_tizen>
334         public static Color operator -(Color arg1)
335         {
336             Color result = arg1.Subtract();
337             return ValueCheck(result);
338         }
339
340         /// <summary>
341         /// The multiplication operator.
342         /// </summary>
343         /// <param name="arg1">The first value.</param>
344         /// <param name="arg2">The second value.</param>
345         /// <returns>The color containing the result of the multiplication.</returns>
346         /// <since_tizen> 3 </since_tizen>
347         public static Color operator *(Color arg1, Color arg2)
348         {
349             Color result = arg1.Multiply(arg2);
350             return ValueCheck(result);
351         }
352
353         /// <summary>
354         /// The multiplication operator.
355         /// </summary>
356         /// <param name="arg1">The first value.</param>
357         /// <param name="arg2">The second value.</param>
358         /// <returns>The color containing the result of the multiplication.</returns>
359         /// <since_tizen> 3 </since_tizen>
360         public static Color operator *(Color arg1, float arg2)
361         {
362             Color result = arg1.Multiply(arg2);
363             return ValueCheck(result);
364         }
365
366         /// <summary>
367         /// The division operator.
368         /// </summary>
369         /// <param name="arg1">The first value.</param>
370         /// <param name="arg2">The second value.</param>
371         /// <returns>The color containing the result of the division.</returns>
372         /// <since_tizen> 3 </since_tizen>
373         public static Color operator /(Color arg1, Color arg2)
374         {
375             Color result = arg1.Divide(arg2);
376             return ValueCheck(result);
377         }
378
379         /// <summary>
380         /// The division operator.
381         /// </summary>
382         /// <param name="arg1">The first value.</param>
383         /// <param name="arg2">The second value.</param>
384         /// <returns>The color containing the result of the division.</returns>
385         /// <since_tizen> 3 </since_tizen>
386         public static Color operator /(Color arg1, float arg2)
387         {
388             Color result = arg1.Divide(arg2);
389             return ValueCheck(result);
390         }
391
392         /// <summary>
393         /// Checks if two color classes are same.
394         /// </summary>
395         /// <param name="rhs">A color to be compared.</param>
396         /// <returns>If two colors are are same, then true.</returns>
397         /// <since_tizen> 3 </since_tizen>
398         public bool EqualTo(Color rhs)
399         {
400             bool ret = Interop.Vector4.Vector4_EqualTo(swigCPtr, Color.getCPtr(rhs));
401
402             if (rhs == null) return false;
403
404             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
405             return ret;
406         }
407
408         /// <summary>
409         /// Checks if two color classes are different.
410         /// </summary>
411         /// <param name="rhs">A color to be compared.</param>
412         /// <returns>If two colors are are different, then true.</returns>
413         /// <since_tizen> 3 </since_tizen>
414         public bool NotEqualTo(Color rhs)
415         {
416             bool ret = Interop.Vector4.Vector4_NotEqualTo(swigCPtr, Color.getCPtr(rhs));
417             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
418             return ret;
419         }
420
421         /// <inheritdoc/>
422         [EditorBrowsable(EditorBrowsableState.Never)]
423         public object Clone() => new Color(this);
424
425         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Color obj)
426         {
427             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
428         }
429
430         internal static Color GetColorFromPtr(global::System.IntPtr cPtr)
431         {
432             Color ret = new Color(cPtr, false);
433             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
434             return ret;
435         }
436
437         internal static Color ValueCheck(Color color)
438         {
439             if (color.R < 0.0f)
440             {
441                 color.R = 0.0f;
442                 NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
443             }
444             else if (color.R > 1.0f)
445             {
446                 color.R = 1.0f;
447                 NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
448             }
449             if (color.G < 0.0f)
450             {
451                 color.G = 0.0f;
452                 NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
453             }
454             else if (color.G > 1.0f)
455             {
456                 color.G = 1.0f;
457                 NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
458             }
459             if (color.B < 0.0f)
460             {
461                 color.B = 0.0f;
462                 NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
463             }
464             else if (color.B > 1.0f)
465             {
466                 color.B = 1.0f;
467                 NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
468             }
469             if (color.A < 0.0f)
470             {
471                 color.A = 0.0f;
472                 NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
473             }
474             else if (color.A > 1.0f)
475             {
476                 color.A = 1.0f;
477                 NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
478             }
479             return color;
480         }
481
482         internal static float ValueCheck(float value)
483         {
484             if (value < 0.0f)
485             {
486                 value = 0.0f;
487                 NUILog.Error("The value of Parameters is invalid! Should be between [0, 1].");
488             }
489             else if (value > 1.0f)
490             {
491                 value = 1.0f;
492                 NUILog.Error("The value of Parameters is invalid! Should be between [0, 1].");
493             }
494             return value;
495         }
496
497         internal static float[] ValueCheck(float[] arr)
498         {
499             for (int i = 0; i < arr.Length; i++)
500             {
501                 if (arr[i] < 0.0f)
502                 {
503                     arr[i] = 0.0f;
504                     NUILog.Error("The value of Parameters is invalid! Should be between [0, 1].");
505                 }
506                 else if (arr[i] > 1.0f)
507                 {
508                     arr[i] = 1.0f;
509                     NUILog.Error("The value of Parameters is invalid! Should be between [0, 1].");
510                 }
511             }
512             return arr;
513         }
514
515         /// This will not be public opened.
516         [EditorBrowsable(EditorBrowsableState.Never)]
517         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
518         {
519             Interop.Vector4.delete_Vector4(swigCPtr);
520         }
521
522         private Color Add(Color rhs)
523         {
524             Color ret = new Color(Interop.Vector4.Vector4_Add(swigCPtr, Color.getCPtr(rhs)), true);
525             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
526             return ret;
527         }
528
529         private Color AddAssign(Vector4 rhs)
530         {
531             Color ret = new Color(Interop.Vector4.Vector4_AddAssign(swigCPtr, Color.getCPtr(rhs)), false);
532             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
533             return ret;
534         }
535
536         private Color Subtract(Color rhs)
537         {
538             Color ret = new Color(Interop.Vector4.Vector4_Subtract__SWIG_0(swigCPtr, Color.getCPtr(rhs)), true);
539             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
540             return ret;
541         }
542
543         private Color SubtractAssign(Color rhs)
544         {
545             Color ret = new Color(Interop.Vector4.Vector4_SubtractAssign(swigCPtr, Color.getCPtr(rhs)), false);
546             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
547             return ret;
548         }
549
550         private Color Multiply(Color rhs)
551         {
552             Color ret = new Color(Interop.Vector4.Vector4_Multiply__SWIG_0(swigCPtr, Color.getCPtr(rhs)), true);
553             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
554             return ret;
555         }
556
557         private Color Multiply(float rhs)
558         {
559             Color ret = new Color(Interop.Vector4.Vector4_Multiply__SWIG_1(swigCPtr, rhs), true);
560             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
561             return ret;
562         }
563
564         private Color MultiplyAssign(Color rhs)
565         {
566             Color ret = new Color(Interop.Vector4.Vector4_MultiplyAssign__SWIG_0(swigCPtr, Color.getCPtr(rhs)), false);
567             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
568             return ret;
569         }
570
571         private Color MultiplyAssign(float rhs)
572         {
573             Color ret = new Color(Interop.Vector4.Vector4_MultiplyAssign__SWIG_1(swigCPtr, rhs), false);
574             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
575             return ret;
576         }
577
578         private Color Divide(Vector4 rhs)
579         {
580             Color ret = new Color(Interop.Vector4.Vector4_Divide__SWIG_0(swigCPtr, Color.getCPtr(rhs)), true);
581             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
582             return ret;
583         }
584
585         private Color Divide(float rhs)
586         {
587             Color ret = new Color(Interop.Vector4.Vector4_Divide__SWIG_1(swigCPtr, rhs), true);
588             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
589             return ret;
590         }
591
592         private Color DivideAssign(Color rhs)
593         {
594             Color ret = new Color(Interop.Vector4.Vector4_DivideAssign__SWIG_0(swigCPtr, Color.getCPtr(rhs)), false);
595             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
596             return ret;
597         }
598
599         private Color DivideAssign(float rhs)
600         {
601             Color ret = new Color(Interop.Vector4.Vector4_DivideAssign__SWIG_1(swigCPtr, rhs), false);
602             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
603             return ret;
604         }
605
606         private Color Subtract()
607         {
608             Color ret = new Color(Interop.Vector4.Vector4_Subtract__SWIG_1(swigCPtr), true);
609             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
610             return ret;
611         }
612
613         private static bool EqualsColorValue(float f1, float f2)
614         {
615             float EPS = (float)Math.Abs(f1 * .00001);
616             if(Math.Abs(f1 - f2) <= EPS)
617             {
618                 return true;
619             }
620             else
621             {
622                 return false;
623             }
624         }
625
626         private static bool EqualsColor(Color c1, Color c2)
627         {
628             return EqualsColorValue(c1.R, c2.R) && EqualsColorValue(c1.G, c2.G)
629                 && EqualsColorValue(c1.B, c2.B) && EqualsColorValue(c1.A, c2.A);
630         }
631
632         /// <summary>
633         /// Determines whether the specified object is equal to the current object.
634         /// </summary>
635         /// <param name="obj">The object to compare with the current object.</param>
636         /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
637         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
638         [EditorBrowsable(EditorBrowsableState.Never)]
639         public override bool Equals(System.Object obj)
640         {
641             Color color = obj as Color;
642             bool equal = false;
643             if (color == null)
644             {
645                 return equal;
646             }
647
648             if (EqualsColor(this, color))
649             {
650                 equal = true;
651             }
652             return equal;
653         }
654
655         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
656         [EditorBrowsable(EditorBrowsableState.Never)]
657         public override int GetHashCode()
658         {
659             return hashDummy.GetHashCode();
660         }
661
662         private float ValueOfIndex(uint index)
663         {
664             float ret = Interop.Vector4.Vector4_ValueOfIndex__SWIG_0(swigCPtr, index);
665             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
666             return ret;
667         }
668
669     }
670
671 }
672
673