Color
public struct ColorAn RGBA colour of four float channels, each normally 0 to 1; the struct does not clamp them. A light’s colour, a material’s albedo or emission, a colour property, a shader colour uniform and an image sensor’s pixel all use it.
Constructors
Section titled “Constructors”public Color(float r, float g, float b, float a = 1f);Creates a colour from red, green, blue and alpha channels, each normally 0 to 1. Alpha defaults to 1, fully opaque.
Properties you read and set
Section titled “Properties you read and set”public float R { get; set; }The red channel, normally 0 to 1.
public float G { get; set; }The green channel, normally 0 to 1.
public float B { get; set; }The blue channel, normally 0 to 1.
public float A { get; set; }The alpha (opacity) channel, normally 0 to 1: 1 is fully opaque and 0 fully transparent, where the thing being coloured uses alpha.
static
public static Color White { get; }Opaque white, (1, 1, 1, 1).
static
public static Color Black { get; }Opaque black, (0, 0, 0, 1).
Transparent
Section titled “Transparent”static
public static Color Transparent { get; }Fully transparent black, (0, 0, 0, 0).
Methods you call
Section titled “Methods you call”static
public static Color Lerp(Color from, Color to, float weight);Blends from from to to channel by channel, alpha included: a weight of 0 gives from and 1 gives to. The weight is not clamped, so values outside 0 to 1 carry on past either colour and can push channels outside 0 to 1.
Equals
Section titled “Equals”override
public override bool Equals(object obj);True when obj is a Color with exactly equal channels.
GetHashCode
Section titled “GetHashCode”override
public override int GetHashCode();A hash of the channels, so the colour can key a dictionary or a set.
ToString
Section titled “ToString”override
public override string ToString();The colour as text, for example Color(1, 0.5, 0, 1).
Operators
Section titled “Operators”operator ==
Section titled “operator ==”static
public static bool operator ==(Color a, Color b);True when all four channels are exactly equal.
operator !=
Section titled “operator !=”static
public static bool operator !=(Color a, Color b);True when any channel differs, compared exactly.
Generated from the CRUMB source, commit fcec660d, 2026-10-29.

