Search Results for

    Show / Hide Table of Contents

    Struct Color32

    Representation of RGBA colors in 32 bit format (8 bits per component in RGBA order).

    Assembly: FlaxEngine.dll
    File: Engine/Core/Math/Color32.h
    Syntax
    public struct Color32

    Constructors

    Color32()

    Empty constructor.

    Declaration
    public Color32() = default

    Color32(byte r, byte g, byte b, byte a)

    Constructs a new Color32 with given r, g, b, a components.

    Declaration
    public Color32(byte r, byte g, byte b, byte a)
    Parameters
    byte r

    The red component value.

    byte g

    The green component value.

    byte b

    The value component value.

    byte a

    The alpha component value.

    Color32(const Color& c)

    Declaration
    public Color32(const Color& c)
    Parameters
    Color c

    Color32(const Vector4& c)

    Declaration
    public Color32(const Vector4& c)
    Parameters
    Vector4 c

    Fields

    A

    Alpha component of the color.

    Declaration
    public byte A
    Field Value
    byte

    B

    Blue component of the color.

    Declaration
    public byte B
    Field Value
    byte

    Black

    Declaration
    public static Color32 Black
    Field Value
    Color32

    G

    Green component of the color.

    Declaration
    public byte G
    Field Value
    byte

    R

    Red component of the color.

    Declaration
    public byte R
    Field Value
    byte

    Raw

    Color packed into 32 bits

    Declaration
    public uint32 Raw
    Field Value
    uint32

    Transparent

    Declaration
    public static Color32 Transparent
    Field Value
    Color32

    White

    Declaration
    public static Color32 White
    Field Value
    Color32

    Methods

    FromRGB(uint32 rgb, byte a=255)

    Initializes from packed RGB value of the color and separate alpha channel value.

    Declaration
    public static Color32 FromRGB(uint32 rgb, byte a=255)
    Parameters
    uint32 rgb

    The packed RGB value.

    byte a

    The alpha channel.

    Returns
    Color32

    The color.

    FromRGBA(float r, float g, float b, float a)

    Declaration
    public static Color32 FromRGBA(float r, float g, float b, float a)
    Parameters
    float r

    float g

    float b

    float a

    Returns
    Color32

    GetAsABGR()

    Declaration
    public uint32 GetAsABGR() const
    Returns
    uint32

    GetAsARGB()

    Declaration
    public uint32 GetAsARGB() const
    Returns
    uint32

    GetAsBGRA()

    Declaration
    public uint32 GetAsBGRA() const
    Returns
    uint32

    GetAsRGB()

    Declaration
    public uint32 GetAsRGB() const
    Returns
    uint32

    GetAsRGBA()

    Declaration
    public uint32 GetAsRGBA() const
    Returns
    uint32

    GetHashCode()

    Declaration
    public uint32 GetHashCode() const
    Returns
    uint32

    GetHashCode(const Color32& v)

    Declaration
    public static uint32 GetHashCode(const Color32& v)
    Parameters
    Color32 v

    Returns
    uint32

    HasOpacity()

    Declaration
    public bool HasOpacity() const
    Returns
    bool

    IsTransparent()

    Declaration
    public bool IsTransparent() const
    Returns
    bool

    Lerp(const Color32& a, const Color32& b, const float t)

    Linearly interpolates between colors a and b by normalized weight t.

    Declaration
    public static Color32 Lerp(const Color32& a, const Color32& b, const float t)
    Parameters
    Color32 a

    The start value.

    Color32 b

    The end value.

    float t

    The linear blend weight.

    Returns
    Color32

    operator!=(const Color32& other)

    Declaration
    public bool operator!=(const Color32& other) const
    Parameters
    Color32 other

    Returns
    bool

    operator-(const Color32& b)

    Declaration
    public Color32 operator-(const Color32& b) const
    Parameters
    Color32 b

    Returns
    Color32

    operator*(const Color32& b)

    Declaration
    public Color32 operator*(const Color32& b) const
    Parameters
    Color32 b

    Returns
    Color32

    operator*(float b)

    Declaration
    public Color32 operator*(float b) const
    Parameters
    float b

    Returns
    Color32

    operator*=(const Color32& b)

    Declaration
    public Color32 operator*=(const Color32& b)
    Parameters
    Color32 b

    Returns
    Color32

    operator+(const Color32& b)

    Declaration
    public Color32 operator+(const Color32& b) const
    Parameters
    Color32 b

    Returns
    Color32

    operator+=(const Color32& b)

    Declaration
    public Color32 operator+=(const Color32& b)
    Parameters
    Color32 b

    Returns
    Color32

    operator-=(const Color32& b)

    Declaration
    public Color32 operator-=(const Color32& b)
    Parameters
    Color32 b

    Returns
    Color32

    operator==(const Color32& other)

    Declaration
    public bool operator==(const Color32& other) const
    Parameters
    Color32 other

    Returns
    bool

    Random()

    Declaration
    public static Color32 Random()
    Returns
    Color32

    ToHexString()

    Declaration
    public String ToHexString() const
    Returns
    String

    ToString()

    Declaration
    public String ToString() const
    Returns
    String

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat