Revert "[NUI] Refactoring Theme and StyleManager (#1981)" (#2013)
[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
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         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Color obj)
422         {
423             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
424         }
425
426         internal static Color GetColorFromPtr(global::System.IntPtr cPtr)
427         {
428             Color ret = new Color(cPtr, false);
429             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
430             return ret;
431         }
432
433         internal static Color ValueCheck(Color color)
434         {
435             if (color.R < 0.0f)
436             {
437                 color.R = 0.0f;
438                 NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
439             }
440             else if (color.R > 1.0f)
441             {
442                 color.R = 1.0f;
443                 NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
444             }
445             if (color.G < 0.0f)
446             {
447                 color.G = 0.0f;
448                 NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
449             }
450             else if (color.G > 1.0f)
451             {
452                 color.G = 1.0f;
453                 NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
454             }
455             if (color.B < 0.0f)
456             {
457                 color.B = 0.0f;
458                 NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
459             }
460             else if (color.B > 1.0f)
461             {
462                 color.B = 1.0f;
463                 NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
464             }
465             if (color.A < 0.0f)
466             {
467                 color.A = 0.0f;
468                 NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
469             }
470             else if (color.A > 1.0f)
471             {
472                 color.A = 1.0f;
473                 NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
474             }
475             return color;
476         }
477
478         internal static float ValueCheck(float value)
479         {
480             if (value < 0.0f)
481             {
482                 value = 0.0f;
483                 NUILog.Error("The value of Parameters is invalid! Should be between [0, 1].");
484             }
485             else if (value > 1.0f)
486             {
487                 value = 1.0f;
488                 NUILog.Error("The value of Parameters is invalid! Should be between [0, 1].");
489             }
490             return value;
491         }
492
493         internal static float[] ValueCheck(float[] arr)
494         {
495             for (int i = 0; i < arr.Length; i++)
496             {
497                 if (arr[i] < 0.0f)
498                 {
499                     arr[i] = 0.0f;
500                     NUILog.Error("The value of Parameters is invalid! Should be between [0, 1].");
501                 }
502                 else if (arr[i] > 1.0f)
503                 {
504                     arr[i] = 1.0f;
505                     NUILog.Error("The value of Parameters is invalid! Should be between [0, 1].");
506                 }
507             }
508             return arr;
509         }
510
511         /// This will not be public opened.
512         [EditorBrowsable(EditorBrowsableState.Never)]
513         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
514         {
515             Interop.Vector4.delete_Vector4(swigCPtr);
516         }
517
518         private Color Add(Color rhs)
519         {
520             Color ret = new Color(Interop.Vector4.Vector4_Add(swigCPtr, Color.getCPtr(rhs)), true);
521             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
522             return ret;
523         }
524
525         private Color AddAssign(Vector4 rhs)
526         {
527             Color ret = new Color(Interop.Vector4.Vector4_AddAssign(swigCPtr, Color.getCPtr(rhs)), false);
528             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
529             return ret;
530         }
531
532         private Color Subtract(Color rhs)
533         {
534             Color ret = new Color(Interop.Vector4.Vector4_Subtract__SWIG_0(swigCPtr, Color.getCPtr(rhs)), true);
535             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
536             return ret;
537         }
538
539         private Color SubtractAssign(Color rhs)
540         {
541             Color ret = new Color(Interop.Vector4.Vector4_SubtractAssign(swigCPtr, Color.getCPtr(rhs)), false);
542             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
543             return ret;
544         }
545
546         private Color Multiply(Color rhs)
547         {
548             Color ret = new Color(Interop.Vector4.Vector4_Multiply__SWIG_0(swigCPtr, Color.getCPtr(rhs)), true);
549             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
550             return ret;
551         }
552
553         private Color Multiply(float rhs)
554         {
555             Color ret = new Color(Interop.Vector4.Vector4_Multiply__SWIG_1(swigCPtr, rhs), true);
556             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
557             return ret;
558         }
559
560         private Color MultiplyAssign(Color rhs)
561         {
562             Color ret = new Color(Interop.Vector4.Vector4_MultiplyAssign__SWIG_0(swigCPtr, Color.getCPtr(rhs)), false);
563             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
564             return ret;
565         }
566
567         private Color MultiplyAssign(float rhs)
568         {
569             Color ret = new Color(Interop.Vector4.Vector4_MultiplyAssign__SWIG_1(swigCPtr, rhs), false);
570             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
571             return ret;
572         }
573
574         private Color Divide(Vector4 rhs)
575         {
576             Color ret = new Color(Interop.Vector4.Vector4_Divide__SWIG_0(swigCPtr, Color.getCPtr(rhs)), true);
577             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
578             return ret;
579         }
580
581         private Color Divide(float rhs)
582         {
583             Color ret = new Color(Interop.Vector4.Vector4_Divide__SWIG_1(swigCPtr, rhs), true);
584             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
585             return ret;
586         }
587
588         private Color DivideAssign(Color rhs)
589         {
590             Color ret = new Color(Interop.Vector4.Vector4_DivideAssign__SWIG_0(swigCPtr, Color.getCPtr(rhs)), false);
591             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
592             return ret;
593         }
594
595         private Color DivideAssign(float rhs)
596         {
597             Color ret = new Color(Interop.Vector4.Vector4_DivideAssign__SWIG_1(swigCPtr, rhs), false);
598             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
599             return ret;
600         }
601
602         private Color Subtract()
603         {
604             Color ret = new Color(Interop.Vector4.Vector4_Subtract__SWIG_1(swigCPtr), true);
605             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
606             return ret;
607         }
608
609         private static bool EqualsColorValue(float f1, float f2)
610         {
611             float EPS = (float)Math.Abs(f1 * .00001);
612             if(Math.Abs(f1 - f2) <= EPS)
613             {
614                 return true;
615             }
616             else
617             {
618                 return false;
619             }
620         }
621
622         private static bool EqualsColor(Color c1, Color c2)
623         {
624             return EqualsColorValue(c1.R, c2.R) && EqualsColorValue(c1.G, c2.G)
625                 && EqualsColorValue(c1.B, c2.B) && EqualsColorValue(c1.A, c2.A);
626         }
627
628         /// <summary>
629         /// Determines whether the specified object is equal to the current object.
630         /// </summary>
631         /// <param name="obj">The object to compare with the current object.</param>
632         /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
633         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
634         [EditorBrowsable(EditorBrowsableState.Never)]
635         public override bool Equals(System.Object obj)
636         {
637             Color color = obj as Color;
638             bool equal = false;
639             if (color == null)
640             {
641                 return equal;
642             }
643
644             if (EqualsColor(this, color))
645             {
646                 equal = true;
647             }
648             return equal;
649         }
650
651         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
652         [EditorBrowsable(EditorBrowsableState.Never)]
653         public override int GetHashCode()
654         {
655             return hashDummy.GetHashCode();
656         }
657
658         private float ValueOfIndex(uint index)
659         {
660             float ret = Interop.Vector4.Vector4_ValueOfIndex__SWIG_0(swigCPtr, index);
661             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
662             return ret;
663         }
664
665     }
666
667 }
668
669