Show / Hide Table of Contents

Struct Color

Implements
IEquatable<Color>
Inherited Members
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetType()
Namespace: UnityEngine
Assembly: UnityEngine.dll
Syntax
public struct Color : IEquatable<Color>

Constructors

| Improve this Doc View Source

Color(Single, Single, Single)

Declaration
public Color(float r, float g, float b)
Parameters
Type Name Description
Single r
Single g
Single b
| Improve this Doc View Source

Color(Single, Single, Single, Single)

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

Fields

| Improve this Doc View Source

a

Declaration
public float a
Field Value
Type Description
Single
| Improve this Doc View Source

b

Declaration
public float b
Field Value
Type Description
Single
| Improve this Doc View Source

g

Declaration
public float g
Field Value
Type Description
Single
| Improve this Doc View Source

r

Declaration
public float r
Field Value
Type Description
Single

Properties

| Improve this Doc View Source

black

Declaration
public static Color black { get; }
Property Value
Type Description
Color
| Improve this Doc View Source

blue

Declaration
public static Color blue { get; }
Property Value
Type Description
Color
| Improve this Doc View Source

clear

Declaration
public static Color clear { get; }
Property Value
Type Description
Color
| Improve this Doc View Source

cyan

Declaration
public static Color cyan { get; }
Property Value
Type Description
Color
| Improve this Doc View Source

gamma

Declaration
public Color gamma { get; }
Property Value
Type Description
Color
| Improve this Doc View Source

gray

Declaration
public static Color gray { get; }
Property Value
Type Description
Color
| Improve this Doc View Source

grayscale

Declaration
public float grayscale { get; }
Property Value
Type Description
Single
| Improve this Doc View Source

green

Declaration
public static Color green { get; }
Property Value
Type Description
Color
| Improve this Doc View Source

grey

Declaration
public static Color grey { get; }
Property Value
Type Description
Color
| Improve this Doc View Source

Item[Int32]

Declaration
public float this[int index] { get; set; }
Parameters
Type Name Description
Int32 index
Property Value
Type Description
Single
| Improve this Doc View Source

linear

Declaration
public Color linear { get; }
Property Value
Type Description
Color
| Improve this Doc View Source

magenta

Declaration
public static Color magenta { get; }
Property Value
Type Description
Color
| Improve this Doc View Source

maxColorComponent

Declaration
public float maxColorComponent { get; }
Property Value
Type Description
Single
| Improve this Doc View Source

red

Declaration
public static Color red { get; }
Property Value
Type Description
Color
| Improve this Doc View Source

white

Declaration
public static Color white { get; }
Property Value
Type Description
Color
| Improve this Doc View Source

yellow

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

Methods

| Improve this Doc View Source

Equals(Object)

Declaration
public override bool Equals(object other)
Parameters
Type Name Description
Object other
Returns
Type Description
Boolean
Overrides
ValueType.Equals(Object)
| Improve this Doc View Source

Equals(Color)

Declaration
public bool Equals(Color other)
Parameters
Type Name Description
Color other
Returns
Type Description
Boolean
| Improve this Doc View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
Int32
Overrides
ValueType.GetHashCode()
| Improve this Doc View Source

HSVToRGB(Single, Single, Single)

Declaration
public static Color HSVToRGB(float H, float S, float V)
Parameters
Type Name Description
Single H
Single S
Single V
Returns
Type Description
Color
| Improve this Doc View Source

HSVToRGB(Single, Single, Single, Boolean)

Declaration
public static Color HSVToRGB(float H, float S, float V, bool hdr)
Parameters
Type Name Description
Single H
Single S
Single V
Boolean hdr
Returns
Type Description
Color
| Improve this Doc View Source

Lerp(Color, Color, Single)

Declaration
public static Color Lerp(Color a, Color b, float t)
Parameters
Type Name Description
Color a
Color b
Single t
Returns
Type Description
Color
| Improve this Doc View Source

LerpUnclamped(Color, Color, Single)

Declaration
public static Color LerpUnclamped(Color a, Color b, float t)
Parameters
Type Name Description
Color a
Color b
Single t
Returns
Type Description
Color
| Improve this Doc View Source

RGBToHSV(Color, out Single, out Single, out Single)

Declaration
public static void RGBToHSV(Color rgbColor, out float H, out float S, out float V)
Parameters
Type Name Description
Color rgbColor
Single H
Single S
Single V
| Improve this Doc View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
String
Overrides
ValueType.ToString()
| Improve this Doc View Source

ToString(String)

Declaration
public string ToString(string format)
Parameters
Type Name Description
String format
Returns
Type Description
String

Operators

| Improve this Doc View Source

Addition(Color, Color)

Declaration
public static Color operator +(Color a, Color b)
Parameters
Type Name Description
Color a
Color b
Returns
Type Description
Color
| Improve this Doc View Source

Division(Color, Single)

Declaration
public static Color operator /(Color a, float b)
Parameters
Type Name Description
Color a
Single b
Returns
Type Description
Color
| Improve this Doc View Source

Equality(Color, Color)

Declaration
public static bool operator ==(Color lhs, Color rhs)
Parameters
Type Name Description
Color lhs
Color rhs
Returns
Type Description
Boolean
| Improve this Doc View Source

Implicit(Color to Vector4)

Declaration
public static implicit operator Vector4(Color c)
Parameters
Type Name Description
Color c
Returns
Type Description
Vector4
| Improve this Doc View Source

Implicit(Vector4 to Color)

Declaration
public static implicit operator Color(Vector4 v)
Parameters
Type Name Description
Vector4 v
Returns
Type Description
Color
| Improve this Doc View Source

Inequality(Color, Color)

Declaration
public static bool operator !=(Color lhs, Color rhs)
Parameters
Type Name Description
Color lhs
Color rhs
Returns
Type Description
Boolean
| Improve this Doc View Source

Multiply(Single, Color)

Declaration
public static Color operator *(float b, Color a)
Parameters
Type Name Description
Single b
Color a
Returns
Type Description
Color
| Improve this Doc View Source

Multiply(Color, Single)

Declaration
public static Color operator *(Color a, float b)
Parameters
Type Name Description
Color a
Single b
Returns
Type Description
Color
| Improve this Doc View Source

Multiply(Color, Color)

Declaration
public static Color operator *(Color a, Color b)
Parameters
Type Name Description
Color a
Color b
Returns
Type Description
Color
| Improve this Doc View Source

Subtraction(Color, Color)

Declaration
public static Color operator -(Color a, Color b)
Parameters
Type Name Description
Color a
Color b
Returns
Type Description
Color

Implements

System.IEquatable<T>

Extension Methods

MustExtensions.MustBeEqual<T>(T, T)
MustExtensions.MustBeEqual<T>(T, T, String)
MustExtensions.MustNotBeEqual<T>(T, T)
MustExtensions.MustNotBeEqual<T>(T, T, String)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX