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
Colorobject (RGBA) to be applied to the picker.
- newCol: The Unity
- 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
_useAlphasetting. If Alpha is disabled in the inspector, any alpha value passed innewColwill be forced to1.0f(255).