Logo
UI Elements

Color Picker

Choose colors through a wheel, sliders, or hex input

Overview

Color Picker keeps a color wheel, HSV controls, opacity, and hex input in sync.

Preview

Usage

Create a Color Picker prefab.

Choose the starting color and configure its available controls.

Connect On Color Changed to update the object or setting being edited.


Public API

Use ColorPicker in the Evo.UI namespace.

Fields

NameTypeDescription
startColorColorInitial and reset color.
resetOnRightClickboolAllows right-click reset.
colorPreviewProceduralShapeProcedural Shape displaying the current color.

Methods

NameParametersDescription
SetColor()Color colorChanges the selected color and updates the controls.
GetCurrentColor()bool withoutBrightness = falseReturns the current color; optionally omits brightness. Returns Color.
SetRGB()float r, float g, float bSets red, green, and blue channels.
SetRed()float valueSets the red channel.
SetGreen()float valueSets the green channel.
SetBlue()float valueSets the blue channel.
SetAlpha()float valueSets opacity.

Events

NameTypeDescription
onColorChangedUnityEvent<Color>Invoked with the selected Color.

Example

ColorPickerExample.cs
using UnityEngine;
using Evo.UI;

public class ColorPickerExample : MonoBehaviour
{
    [SerializeField] private ColorPicker target;

    private void Start()
    {
        target.SetColor(new Color(0.2f, 0.6f, 1f, 1f));
        target.onColorChanged.AddListener(color => Debug.Log($"Color: {color}"));
    }
}

On this page