Class ColorUtilities
A set of utilities to manipulate color values.
Inheritance
Namespace: UnityEngine.Rendering.PostProcessing
Syntax
public static class ColorUtilities
Methods
CIExyToLMS(Single, Single)
Converts CIExy chromaticity to CAT02 LMS.
Declaration
public static Vector3 CIExyToLMS(float x, float y)
Parameters
| Type | Name | Description | 
|---|---|---|
| System.Single | x | The X coordinate  | 
| System.Single | y | The Y coordinate  | 
Returns
| Type | Description | 
|---|---|
| Vector3 | The CIExy chromaticity converted to CAT02 LMS  | 
Remarks
ColorToGain(Vector4)
Converts trackball values to Gain coefficients.
Declaration
public static Vector3 ColorToGain(Vector4 color)
Parameters
| Type | Name | Description | 
|---|---|---|
| Vector4 | color | The trackball color value (with offset in the W component)  | 
Returns
| Type | Description | 
|---|---|
| Vector3 | The converted trackball value  | 
ColorToInverseGamma(Vector4)
Converts trackball values to inverted Gamma coefficients.
Declaration
public static Vector3 ColorToInverseGamma(Vector4 color)
Parameters
| Type | Name | Description | 
|---|---|---|
| Vector4 | color | The trackball color value (with offset in the W component)  | 
Returns
| Type | Description | 
|---|---|
| Vector3 | The converted trackball value  | 
ColorToLift(Vector4)
Converts trackball values to Lift coefficients.
Declaration
public static Vector3 ColorToLift(Vector4 color)
Parameters
| Type | Name | Description | 
|---|---|---|
| Vector4 | color | The trackball color value (with offset in the W component)  | 
Returns
| Type | Description | 
|---|---|
| Vector3 | The converted trackball value  | 
ComputeColorBalance(Single, Single)
Computes the color balance coefficients in the CAT02 LMS space.
Declaration
public static Vector3 ComputeColorBalance(float temperature, float tint)
Parameters
| Type | Name | Description | 
|---|---|---|
| System.Single | temperature | The color temperature offset  | 
| System.Single | tint | The color tint offset (green/magenta)  | 
Returns
| Type | Description | 
|---|---|
| Vector3 | The color balance coefficients in the CAT02 LMS space.  | 
LinearToLogC(Single)
Converts a linear value to LogC (Alexa El 1000).
Declaration
public static float LinearToLogC(float x)
Parameters
| Type | Name | Description | 
|---|---|---|
| System.Single | x | A linear value  | 
Returns
| Type | Description | 
|---|---|
| System.Single | The input value converted to LogC  | 
LogCToLinear(Single)
Converts a LogC (Alexa El 1000) value to linear.
Declaration
public static float LogCToLinear(float x)
Parameters
| Type | Name | Description | 
|---|---|---|
| System.Single | x | A LogC (Alexa El 1000) value  | 
Returns
| Type | Description | 
|---|---|
| System.Single | The input convert to linear  | 
StandardIlluminantY(Single)
Gets the Y coordinate for the chromaticity of the standard illuminant.
Declaration
public static float StandardIlluminantY(float x)
Parameters
| Type | Name | Description | 
|---|---|---|
| System.Single | x | The X coordinate  | 
Returns
| Type | Description | 
|---|---|
| System.Single | The Y coordinate for the chromaticity of the standard illuminant  | 
Remarks
Based on: "An analytical model of chromaticity of the standard illuminant" by Judd et al. http://en.wikipedia.org/wiki/Standard_illuminant#Illuminant_series_D Slightly modified to adjust it with the D65 white point (x=0.31271, y=0.32902).
ToHex(Color)
Converts a color to its ARGB hexadecimal representation.
Declaration
public static uint ToHex(Color c)
Parameters
| Type | Name | Description | 
|---|---|---|
| Color | c | The color to convert  | 
Returns
| Type | Description | 
|---|---|
| System.UInt32 | The color converted to its ARGB hexadecimal representation  | 
ToRGBA(UInt32)
Converts an ARGB hexadecimal input to a color structure.
Declaration
public static Color ToRGBA(uint hex)
Parameters
| Type | Name | Description | 
|---|---|---|
| System.UInt32 | hex | The hexadecimal input  | 
Returns
| Type | Description | 
|---|---|
| Color | The ARGB hexadecimal input converted to a color structure.  |