Class ColorPreset
Object that contains a list of predefined colors and parameters to generate more colors.
Namespace: Unity.MARS.Authoring
Syntax
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 |