Color

An unclamped, linear-light RGBA color for HDR values, graphics buffers and engine interop. RGB fields are linear; alpha is linear and is not premultiplied.

Properties

Rgb

(Vector3): The RGB channels as a Vector3, dropping alpha. Used for vertex colors.

White

(Color)

Black

(Color)

RoughGreen

(Color)

Red

(Color): // main

Green

(Color)

Blue

(Color)

Yellow

(Color): // mix1

Magenta

(Color)

Cyan

(Color)

Gray

(Color)

Pink

(Color): // others

Orange

(Color)

Purple

(Color)

Brown

(Color)

Beige

(Color)

Olive

(Color)

Maroon

(Color)

(Color)

Teal

(Color)

Lime

(Color): // others2

Turquoise

(Color)

Lavender

(Color)

Coral

(Color)

Salmon

(Color)

Peach

(Color)

Mint

(Color)

PowderBlue

(Color)

LightGray

(Color)

WhiteSmoke

(Color)

Public Methods

FromSrgb

public static Color FromSrgb(Color32 color)

Decodes an sRGB byte color to linear-light floats.

Parameters:

  • color (Color32)

Returns: Color

FromHex

public static Color FromHex(string value)

Decodes an sRGB hexadecimal color to linear-light floats.

Parameters:

  • value (string)

Returns: Color

ToSrgb

public Color32 ToSrgb()

Encodes this color as sRGB bytes. HDR and negative RGB components, and alpha outside 0..1, are clamped because the destination cannot represent them.

Returns: Color32

Lerp

public static Color Lerp(Color start, Color end, float amount)

Linearly interpolates unclamped channel values.

Parameters:

  • start (Color)
  • end (Color)
  • amount (float)

Returns: Color

ToString

public override string ToString()

Formats the four fields using invariant culture for deterministic diagnostics.

Returns: string