Detailed Method Reference

Namespace: Canley.Utility.ColourPicker
Class: CanleyColourController

SetColor

public void SetColor(Color newCol)
  • Description: The primary external entry point to update the picker’s state. It initiates a smooth transition (lerp) from the current color to the target newCol, synchronizing all RGB/Alpha sliders, input fields, and the hexadecimal text automatically.
  • Parameters:
    • newCol: The Unity Color object (RGBA) to be applied to the picker.
  • Returns: void
  • Example:
using UnityEngine;
using Canley.Utility.ColourPicker;
 
public class PickerLinker : MonoBehaviour 
{
    public CanleyColourController picker;
 
    public void ResetToWhite() 
    {
        // Smoothly transition the picker to pure white
        picker.SetColor(Color.white);
    }
}

TIP

This method honors the _useAlpha setting. If Alpha is disabled in the inspector, any alpha value passed in newCol will be forced to 1.0f (255).