Detailed Configuration

Property: UseAlpha (bool)

Overview

The Alpha Support system determines whether the picker treats colors as RGB (Opaque) or RGBA (Transparent).

Automated Workflow

When UseAlpha is modified, the CanleyColourController performs the following steps automatically:

  1. UI Visibility: Hides or shows the “A” (Alpha) slider and the corresponding numerical input field.
  2. Layout Rebuild: Initiates a coroutine that waits for the end of the frame, then calls ForceLayoutRebuild(). This ensures the UI container shrinks or grows to fit the active elements perfectly.
  3. Visual Elements:
    • Swatches enable/disable a checkerboard background.
    • The main preview window toggles its transparency preview.

Code Example

[SerializeField] private CanleyColourController _picker;
 
public void SetOpaqueMode()
{
    // Disabling Alpha will automatically hide the UI elements 
    // and resize the picker panel.
    _picker.UseAlpha = false;
}