docs.unity3d.com
    Show / Hide Table of Contents

    Class ColorPreset

    Object that contains a list of predefined colors and parameters to generate more colors.

    Inheritance
    Object
    Object
    ScriptableObject
    ColorPreset
    Inherited Members
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(String)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(Object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, Boolean)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, Single)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectOfType<T>()
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.ToString()
    Object.name
    Object.hideFlags
    Namespace: Unity.MARS.Authoring
    Syntax
    [CreateAssetMenu(fileName = "ColorPreset", menuName = "MARS/ColorPreset")]
    [MovedFrom("Unity.MARS")]
    public class ColorPreset : ScriptableObject

    Methods

    GetColor(Int32)

    Gets the color for a given index. This will choose from the predefined list or generate a color based on the index.

    Declaration
    public Color GetColor(int colorIndex)
    Parameters
    Type Name Description
    Int32 colorIndex

    The index into the list of predefined colors. If greater than the list length, it will be the index into the procedural color generation.

    Returns
    Type Description
    Color

    A new color from this preset.

    GetNewSaturation(Int32)

    Generate a saturation (HSV) in the defined range

    Declaration
    public float GetNewSaturation(int index)
    Parameters
    Type Name Description
    Int32 index

    Index into the sequence

    Returns
    Type Description
    Single

    Saturation value from 0 to 1

    GetNewValue(Int32)

    Generate a value (HSV) in the defined color range

    Declaration
    public float GetNewValue(int index)
    Parameters
    Type Name Description
    Int32 index

    Index into the sequence

    Returns
    Type Description
    Single

    Value from 0 to 1

    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