ColorPicker Dialog

Options

  • Color Picker ColorPicker

    ColorPicker.

  • Close Button Button

    Button to close picker without selecting value.

  • Hide on Modal Click bool

    Close picker on click on the background if the modal option enabled.

  • Mode PickerMode

    Close picker when value selected or when OK button clicked.

  • Ok Button Button

    Button to select and close picker.

Code examples

namespace UIWidgets.Examples
{
    using UIWidgets;
    using UnityEngine;
    using UnityEngine.UI;

    public class TestColorPickerDialog : MonoBehaviour
    {
        [SerializeField]
        ColorPickerDialog InputColor;

        Color currentValue = Color.white;

        async public void Test()
        {
                            var result = await InputColor.Clone().ShowAsync(currentValue);
                            if (result.Success)
                            {
                                    currentValue = result.Value;
                Debug.Log("value: " + currentValue);
                            }
            else
            {
                Debug.Log("canceled");
            }
        }
    }
}