Struct Color | Project Tiny | 0.21.0-preview.3
docs.unity3d.com
    Show / Hide Table of Contents

    Struct Color

    RGBA floating-point color.

    Namespace: Unity.Tiny
    Syntax
    public struct Color : IEquatable<Color>

    Constructors

    Color(Single, Single, Single, Single)

    Declaration
    public Color(float red, float green, float blue, float alpha = 1F)
    Parameters
    Type Name Description
    Single red
    Single green
    Single blue
    Single alpha

    Fields

    Value

    Declaration
    public float4 Value
    Field Value
    Type Description
    float4

    Properties

    a

    Alpha value, range is [0..1]

    Declaration
    public float a { get; set; }
    Property Value
    Type Description
    Single

    b

    Blue value, range is [0..1]

    Declaration
    public float b { get; set; }
    Property Value
    Type Description
    Single

    Default

    Declaration
    public static Color Default { get; }
    Property Value
    Type Description
    Color

    g

    Green value, range is [0..1]

    Declaration
    public float g { get; set; }
    Property Value
    Type Description
    Single

    r

    Red value, range is [0..1]

    Declaration
    public float r { get; set; }
    Property Value
    Type Description
    Single

    Methods

    AsFloat4()

    Declaration
    public float4 AsFloat4()
    Returns
    Type Description
    float4

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean
    Overrides
    ValueType.Equals(Object)

    Equals(Color)

    Declaration
    public bool Equals(Color c)
    Parameters
    Type Name Description
    Color c
    Returns
    Type Description
    Boolean

    FromFloat4(float4)

    Declaration
    public void FromFloat4(float4 c)
    Parameters
    Type Name Description
    float4 c

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32
    Overrides
    ValueType.GetHashCode()

    Lerp(Color, Color, Single)

    Declaration
    public static Color Lerp(Color c1, Color c2, float time)
    Parameters
    Type Name Description
    Color c1
    Color c2
    Single time
    Returns
    Type Description
    Color

    ToLinear()

    Declaration
    public float4 ToLinear()
    Returns
    Type Description
    float4

    Operators

    Addition(Color, Color)

    Declaration
    public static Color operator +(Color cl, Color cr)
    Parameters
    Type Name Description
    Color cl
    Color cr
    Returns
    Type Description
    Color

    Equality(Color, Color)

    Declaration
    public static bool operator ==(Color cl, Color cr)
    Parameters
    Type Name Description
    Color cl
    Color cr
    Returns
    Type Description
    Boolean

    Inequality(Color, Color)

    Declaration
    public static bool operator !=(Color cl, Color cr)
    Parameters
    Type Name Description
    Color cl
    Color cr
    Returns
    Type Description
    Boolean

    Multiply(Color, Single)

    Declaration
    public static Color operator *(Color cl, float v)
    Parameters
    Type Name Description
    Color cl
    Single v
    Returns
    Type Description
    Color

    Multiply(Color, Color)

    Declaration
    public static Color operator *(Color cl, Color cr)
    Parameters
    Type Name Description
    Color cl
    Color cr
    Returns
    Type Description
    Color
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023