docs.unity3d.com
    Show / Hide Table of Contents

    Class ColorUtilities

    A set of utilities to manipulate color values.

    Inheritance
    Object
    ColorUtilities
    Namespace: UnityEngine.Rendering.PostProcessing
    Syntax
    public static class ColorUtilities : object

    Methods

    CIExyToLMS(Single, Single)

    Converts CIExy chromaticity to CAT02 LMS.

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

    The X coordinate

    Single 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(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
    Single temperature

    The color temperature offset

    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
    Single x

    A linear value

    Returns
    Type Description
    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
    Single x

    A LogC (Alexa El 1000) value

    Returns
    Type Description
    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
    Single x

    The X coordinate

    Returns
    Type Description
    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
    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
    UInt32 hex

    The hexadecimal input

    Returns
    Type Description
    Color

    The ARGB hexadecimal input converted to a color structure.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023