UI Elements
Color Picker
A full featured color picker
Overview
Color Picker provides a complete color selection interface with radial or square picker modes, HSV sliders, an opacity slider, a hex input field, and an optional color preview. It supports drag based wheel selection, slider based adjustments, and color synchronization across all controls.
The component can output the final color through events and offers utility methods for setting RGB, HSV, and alpha values.

Properties
Settings
| Name | Type | Description |
|---|---|---|
resetOnRightClick | bool | Resets to startColor when right clicking the wheel |
startColor | Color | Initial color applied at startup |
pickerType | ColorPickerType | Picker mode: None, Radial, or Square |
wheelSize | TextureSize | Resolution used to generate wheel texture |
References
| Name | Type | Description |
|---|---|---|
colorWheel | Image | Image displaying the generated color wheel or square texture |
colorPreview | Image | Visual preview of the currently selected color |
colorSelector | RectTransform | Handle indicating the current hue and saturation |
hexInput | TMP_InputField | Optional hex input (#RRGGBBAA) |
hueSlider | Slider | Slider for hue control |
hueGradient | ImageGradient | Gradient background for hue slider |
saturationSlider | Slider | Slider for saturation control |
saturationGradient | ImageGradient | Gradient background for saturation slider |
brightnessSlider | Slider | Slider for brightness (value) control |
brightnessGradient | ImageGradient | Gradient background for brightness slider |
opacitySlider | Slider | Slider controlling alpha transparency |
opacityGradient | ImageGradient | Gradient background for opacity slider |
Events
| Name | Type | Description |
|---|---|---|
onColorChanged | UnityEvent<Color> | Invoked whenever the color changes |
Public Methods
| Name | Parameters | Description |
|---|---|---|
SetColor(color) | Color | Sets color and updates all controls |
GetCurrentColor(withoutBrightness) | bool | Gets current color, optionally ignoring brightness |
SetRGB(r, g, b) | float, float, float | Sets color via RGB values |
SetRed(value) | float | Sets only the red channel |
SetGreen(value) | float | Sets only the green channel |
SetBlue(value) | float | Sets only the blue channel |
SetAlpha(value) | float | Sets only the alpha value |
Code Example
using UnityEngine;
using Evo.UI;
public class ColorPickerExample : MonoBehaviour
{
public ColorPicker picker;
void Start()
{
// Listen to color changes
picker.onColorChanged.AddListener(color =>
{
Debug.Log("New color: " + color);
});
// Set color
picker.SetColor(Color.red);
// Edit RGB directly
picker.SetRGB(0.2f, 0.8f, 0.3f);
// Set alpha
picker.SetAlpha(0.5f);
// Read current color
Color selected = picker.GetCurrentColor();
Debug.Log("Selected color: " + selected);
}
}