docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ColorUtilities

    A set of utilities to manipulate color values.

    Inheritance
    object
    ColorUtilities
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Rendering.PostProcessing
    Assembly: Unity.Postprocessing.Runtime.dll
    Syntax
    public static class ColorUtilities

    Methods

    CIExyToLMS(float, float)

    Converts CIExy chromaticity to CAT02 LMS.

    Declaration
    public static Vector3 CIExyToLMS(float x, float y)
    Parameters
    Type Name Description
    float x

    The X coordinate

    float y

    The Y coordinate

    Returns
    Type Description
    Vector3

    The CIExy chromaticity converted to CAT02 LMS

    Remarks

    See: http://en.wikipedia.org/wiki/LMS_color_space#CAT02

    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(float, float)

    Computes the color balance coefficients in the CAT02 LMS space.

    Declaration
    public static Vector3 ComputeColorBalance(float temperature, float tint)
    Parameters
    Type Name Description
    float temperature

    The color temperature offset

    float tint

    The color tint offset (green/magenta)

    Returns
    Type Description
    Vector3

    The color balance coefficients in the CAT02 LMS space.

    LinearToLogC(float)

    Converts a linear value to LogC (Alexa El 1000).

    Declaration
    public static float LinearToLogC(float x)
    Parameters
    Type Name Description
    float x

    A linear value

    Returns
    Type Description
    float

    The input value converted to LogC

    LogCToLinear(float)

    Converts a LogC (Alexa El 1000) value to linear.

    Declaration
    public static float LogCToLinear(float x)
    Parameters
    Type Name Description
    float x

    A LogC (Alexa El 1000) value

    Returns
    Type Description
    float

    The input convert to linear

    StandardIlluminantY(float)

    Gets the Y coordinate for the chromaticity of the standard illuminant.

    Declaration
    public static float StandardIlluminantY(float x)
    Parameters
    Type Name Description
    float x

    The X coordinate

    Returns
    Type Description
    float

    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
    uint

    The color converted to its ARGB hexadecimal representation

    ToRGBA(uint)

    Converts an ARGB hexadecimal input to a color structure.

    Declaration
    public static Color ToRGBA(uint hex)
    Parameters
    Type Name Description
    uint hex

    The hexadecimal input

    Returns
    Type Description
    Color

    The ARGB hexadecimal input converted to a color structure.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)