World Utilities / Values
Color
An RGBA color value (optionally HDR) for lights, materials and UI.
since v0.1.0localsynchronizedpersistednetworked
| Component | Add Component menu / prefab | Source |
|---|---|---|
Local ColorVRCTools.World.LocalValues.LocalColor
|
Local Values › Local Colorprefab: Local Color.prefab
|
LocalColor.cs ↗ |
Synchronized ColorVRCTools.World.SynchronizedValues.SynchronizedColor
|
Synchronized Values › Synchronized Colorprefab: Synchronized Color.prefab
|
SynchronizedColor.cs ↗ |
Persisted ColorVRCTools.World.PersistedValues.PersistedColor
|
Persisted Values › Persisted Colorprefab: Persisted Color.prefab
|
PersistedColor.cs ↗ |
A color value stores a Unity Color. Feed it into a
Material Property applicator to recolor
materials, let players pick it with the Color Picker or derive
complementary colors with a Color Adjustment
converter.
Parameters
| Parameter | Default | Description |
|---|---|---|
| Default Value | (0, 0, 0, 0) |
The state the value is initialized with. |
| Permit Alpha | true |
Whether the inspector’s color field allows editing the alpha channel. |
| Permit HDR | false |
Whether the inspector’s color field allows HDR (intensity above 1) colors. |
| Key (persisted only) | PlayerData key used to store the value. Required - see choosing keys. |
Permit Alpha and Permit HDR only affect the inspector - they are not enforced when the value is changed at runtime.
Synchronized variants additionally expose the networking settings.
Networked values need a unique hierarchy path - see naming networked objects.
Events
| Event | Kinds | Description |
|---|---|---|
EVENT_STATE_UPDATED |
all | The state changed (also emitted once with the initial state). |
EVENT_STATE_RESET |
local, persisted | _Reset() restored the default value. |
EVENT_LOADED |
persisted | Stored data has been restored - see loading. |
EVENT_PERSIST |
persisted | The state has been written to player data. |
Functions
| Function | Kinds | Description |
|---|---|---|
_Reset() |
local, persisted | Restores Default Value. |
Use a Color Preset to set a specific color from a button, or a Color Component Converter to build a color from individual float values (e.g. three sliders).