Class Color

    Definition

    Namespace:
    Tizen.NUI
    Assembly:
    Tizen.NUI.dll

    The Color class. This class represents a color using red, green, blue, and alpha components. It provides methods to create and manipulate colors.

    public class Color : Disposable, IDisposable, ICloneable
    Inheritance
    object
    Disposable
    Color
    Implements
    System.IDisposable
    System.ICloneable

    Constructors

    View Source

    Color()

    Default constructor

    Declaration
    public Color()
    View Source

    Color(float, float, float, float)

    The constructor.

    Declaration
    public Color(float r, float g, float b, float a)
    Parameters
    Type Name Description
    float r

    The red component.

    float g

    The green component.

    float b

    The blue component.

    float a

    The alpha component.

    View Source

    Color(float[])

    The conversion constructor from an array of four floats.

    Declaration
    public Color(float[] array)
    Parameters
    Type Name Description
    float[] array

    array Array of R,G,B,A.

    Fields

    View Source

    Black

    Gets the black colored Color class.

    Declaration
    public static readonly Color Black
    Field Value
    Type Description
    Color
    View Source

    Blue

    Gets the blue colored Color class.

    Declaration
    public static readonly Color Blue
    Field Value
    Type Description
    Color
    View Source

    Cyan

    Gets the cyan colored Color class.

    Declaration
    public static readonly Color Cyan
    Field Value
    Type Description
    Color
    View Source

    Green

    Gets the green colored Color class.

    Declaration
    public static readonly Color Green
    Field Value
    Type Description
    Color
    View Source

    Magenta

    Gets the magenta colored Color class.

    Declaration
    public static readonly Color Magenta
    Field Value
    Type Description
    Color
    View Source

    Red

    Gets the red colored Color class.

    Declaration
    public static readonly Color Red
    Field Value
    Type Description
    Color
    View Source

    Transparent

    Gets the transparent colored Color class.

    Declaration
    public static readonly Color Transparent
    Field Value
    Type Description
    Color
    View Source

    White

    Gets the white colored Color class.

    Declaration
    public static readonly Color White
    Field Value
    Type Description
    Color
    View Source

    Yellow

    Gets the yellow colored Color class.

    Declaration
    public static readonly Color Yellow
    Field Value
    Type Description
    Color

    Properties

    View Source

    A

    The alpha component.

    Declaration
    public float A { get; set; }
    Property Value
    Type Description
    float
    Remarks

    The setter is deprecated in API8 and will be removed in API10. Use the new Color(...) constructor.

    View Source

    B

    The blue component.

    Declaration
    public float B { get; set; }
    Property Value
    Type Description
    float
    Remarks

    The setter is deprecated in API8 and will be removed in API10. Use the new Color(...) constructor.

    View Source

    G

    The green component.

    Declaration
    public float G { get; set; }
    Property Value
    Type Description
    float
    Remarks

    The setter is deprecated in API8 and will be removed in API10. Use the new Color(...) constructor.

    View Source

    this[uint]

    The array subscript operator overload.

    Declaration
    public float this[uint index] { get; }
    Parameters
    Type Name Description
    uint index

    The subscript index.

    Property Value
    Type Description
    float

    The float at the given index.

    View Source

    R

    The red component.

    Declaration
    public float R { get; set; }
    Property Value
    Type Description
    float
    Remarks

    The setter is deprecated in API8 and will be removed in API10. Use the new Color(...) constructor.

    Methods

    View Source

    EqualTo(Color)

    Checks if two color classes are same.

    Declaration
    public bool EqualTo(Color rhs)
    Parameters
    Type Name Description
    Color rhs

    A color to be compared.

    Returns
    Type Description
    bool

    If two colors are are same, then true.

    View Source

    NotEqualTo(Color)

    Checks if two color classes are different.

    Declaration
    public bool NotEqualTo(Color rhs)
    Parameters
    Type Name Description
    Color rhs

    A color to be compared.

    Returns
    Type Description
    bool

    If two colors are are different, then true.

    Operators

    View Source

    operator +(Color, Color)

    The addition operator.

    Declaration
    public static Color operator +(Color arg1, Color arg2)
    Parameters
    Type Name Description
    Color arg1

    The first value.

    Color arg2

    The second value.

    Returns
    Type Description
    Color

    The color containing the result of the addition.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when arg1 is null.

    View Source

    operator /(Color, float)

    The division operator.

    Declaration
    public static Color operator /(Color arg1, float arg2)
    Parameters
    Type Name Description
    Color arg1

    The first value.

    float arg2

    The second value.

    Returns
    Type Description
    Color

    The color containing the result of the division.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when arg1 is null.

    View Source

    operator /(Color, Color)

    The division operator.

    Declaration
    public static Color operator /(Color arg1, Color arg2)
    Parameters
    Type Name Description
    Color arg1

    The first value.

    Color arg2

    The second value.

    Returns
    Type Description
    Color

    The color containing the result of the division.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when arg1 is null.

    View Source

    implicit operator Vector4(Color)

    Converts the Color class to Vector4 class implicitly.

    Declaration
    public static implicit operator Vector4(Color color)
    Parameters
    Type Name Description
    Color color

    A color to be converted to Vector4

    Returns
    Type Description
    Vector4
    View Source

    implicit operator Color(Vector4)

    Converts Vector4 class to Color class implicitly.

    Declaration
    public static implicit operator Color(Vector4 vec)
    Parameters
    Type Name Description
    Vector4 vec

    A Vector4 to be converted to color.

    Returns
    Type Description
    Color
    View Source

    operator *(Color, float)

    The multiplication operator.

    Declaration
    public static Color operator *(Color arg1, float arg2)
    Parameters
    Type Name Description
    Color arg1

    The first value.

    float arg2

    The second value.

    Returns
    Type Description
    Color

    The color containing the result of the multiplication.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when arg1 is null.

    View Source

    operator *(Color, Color)

    The multiplication operator.

    Declaration
    public static Color operator *(Color arg1, Color arg2)
    Parameters
    Type Name Description
    Color arg1

    The first value.

    Color arg2

    The second value.

    Returns
    Type Description
    Color

    The color containing the result of the multiplication.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when arg1 is null.

    View Source

    operator -(Color, Color)

    The subtraction operator.

    Declaration
    public static Color operator -(Color arg1, Color arg2)
    Parameters
    Type Name Description
    Color arg1

    The first value.

    Color arg2

    The second value.

    Returns
    Type Description
    Color

    The color containing the result of the subtraction.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when arg1 is null.

    View Source

    operator -(Color)

    The unary negation operator.

    Declaration
    public static Color operator -(Color arg1)
    Parameters
    Type Name Description
    Color arg1

    The target value.

    Returns
    Type Description
    Color

    The color containg the negation.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when arg1 is null.

    Implements

    System.IDisposable
    System.ICloneable
    • View Source
    Back to top Copyright © 2016-2024 Samsung
    Generated by DocFX