C# CustomView Implementation (C++ wrappers, manual bindings, C# wrappers)
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / manual / csharp / Color.cs
index 2d8ef92..0082950 100644 (file)
@@ -24,12 +24,12 @@ public class Color : Vector4
            public Color(float red, float green, float blue, float alpha)
                : base(red, green, blue, alpha)
            { }
-   
+
   /**
    * @brief constructor
    *
    * @since 1.0.0
-   * @param [in] o The Vector Position r, g, b, a.
+   * @param [in] o The Vector4 having r g b a components
    */
           public Color(Vector4 o)
                : base(o.x, o.y, o.z, o.w)
@@ -95,32 +95,41 @@ public class Color : Vector4
                a = alpha;
            }
 
-  ///< name "R", type float (Color R value)
-  //@since 1.0.0
+      /**
+       * @brief name "R", type float (Color's Red component)
+       * @SINCE_1_0.0
+       */
+
            public float R
            {
                get { return r; }
                set { r = value; }
            }
 
-  ///< name "G", type float (Color G value)
-  //@since 1.0.0
+      /**
+       * @brief name "G", type float (Color's Green component)
+       * @SINCE_1_0.0
+       */
            public float G
            {
                get { return g; }
                set { g = value; }
            }
 
-  ///< name "B", type float (Color B value)
-  //@since 1.0.0
+      /**
+       * @brief name "B", type float (Color's Blue component)
+       * @SINCE_1_0.0
+       */
            public float B
            {
                get { return b; }
                set { b = value; }
            }
 
-  ///< name "A", type float (Color A value)
-  //@since 1.0.0
+      /**
+       * @brief name "A", type float (Color's Alpha value)
+       * @SINCE_1_0.0
+       */
            public float A
            {
                get { return a; }
@@ -128,6 +137,58 @@ public class Color : Vector4
            }
 
   /**
+   * @brief operator+
+   *
+   * @since 1.0.0
+   * @param [in] l The Color to add.
+   * @param [in] r The Color to add
+   * @return A reference to this
+   */
+           public static Color operator +(Color l, Color r)
+           {
+               return new Color(l.R + r.R, l.G + r.G, l.B + r.B, l.A + r.A);
+           }
+
+  /**
+   * @brief operator-
+   *
+   * @since 1.0.0
+   * @param [in] l The Color to substract.
+   * @param [in] r The Color to substract
+   * @return A reference to this
+   */
+           public static Color operator -(Color l, Color r)
+           {
+               return new Color(l.R - r.R, l.G - r.G, l.B - r.B, l.A - r.A);
+           }
+
+  /**
+   * @brief operator*
+   *
+   * @since 1.0.0
+   * @param [in] a The Color to multiply.
+   * @param [in] b The Color to multiply
+   * @return A reference to this
+   */
+           public static Color operator *(Color a, double b)
+           {
+               return new Color((int)(a.R * b), (int)(a.G * b), (int)(a.B * b), (int)(a.A * b));
+           }
+
+  /**
+   * @brief operator/
+   *
+   * @since 1.0.0
+   * @param [in] a The Color to divide.
+   * @param [in] b The Color to divide
+   * @return float value of division operation
+   */
+           public static float operator /(Color a, Color b)
+           {
+               return (float)System.Math.Sqrt((a.R / b.R) * (a.G / b.G) * (a.B / b.B) * (a.A / b.A));
+           }
+
+  /**
    * @brief Equals
    *
    * @since 1.0.0