ColorPickerManager API
ColorPickerManager is the facade component that coordinates every subsystem of the Chroma Palette UI.
Related Enums
ChromaPaletteMode
Defines the available palette layouts:
public enum ChromaPaletteMode
{
Rectangle = 0, // HSV rectangle with separate hue slider
Circle = 1, // Hue wheel with saturation radius
CircleFull = 2, // All-in-one HSV circle (no extra sliders)
CircleCircle = 3, // Hue ring with inner saturation/value disc
CircleTriangle = 4, // Hue ring with inner HSV triangle
Texture = 5, // Samples from a provided texture
Palette = 6 // Samples from a ColorPalette asset
}
CursorContrastMode
Controls cursor visibility enhancement:
public enum CursorContrastMode
{
None = 0, // Default cursor appearance
InvertColor = 1, // Invert RGB for maximum contrast
InvertLightness = 2 // Adjust brightness for readability
}
Inspector Fields
| Field | Type | Description |
|---|---|---|
mode | ChromaPaletteMode | Default palette mode (serialized field) |
textureSettings | TextureModeSettings | Configuration for Texture mode |
paletteSettings | PaletteModeSettings | Configuration for Palette mode |
paletteImage | RawImage | Main palette display |
paletteRect | RectTransform | Palette bounds |
paletteCursor | Image | Primary cursor |
paletteCursorExternal | Image | Secondary cursor (for dual-cursor modes) |
hueSlider | Slider | Hue selection slider |
valueSlider | Slider | Value/brightness slider |
alphaSlider | Slider | Alpha transparency slider |
colorImage | Image | Current color preview |
previousColorImage | Image | Previous color display |
inputH/S/V/R/G/B/C/M/Y/K/Hex/Alpha | TMP_InputField | Text inputs for every supported color space |
onColorChanging | UnityEvent<Color> | Live preview event |
onColorChanged | UnityEvent<Color> | Final selection event |
Properties
| Property | Type | Description |
|---|---|---|
CurrentColor | Color | Gets the currently selected color |
IsDragging | bool | Indicates whether the user is actively dragging |
CursorContrast | CursorContrastMode | Get/set cursor contrast mode |
OnColorChanging | UnityEvent<Color> | Exposes the live preview event |
OnColorChanged | UnityEvent<Color> | Exposes the final selection event |
Methods
| Method | Description |
|---|---|
void SetColor(Color color, bool notify = true) | Sets the current color. Pass notify = false to update UI without firing events. |
void SetMode(ChromaPaletteMode newMode) | Switches the active palette layout (Rectangle, Circle, Texture, Palette, etc.). |
void SetPaletteTexture(Texture2D texture) | Assigns a texture and switches to Texture mode. |
void ForceReapplyMaterials() | Rebuilds internal materials (useful after shader swaps). |
void UpdatePaletteMode(ChromaPaletteMode mode) | Forces shader refresh for the specified mode. |
void UpdateAllUI() | Refreshes all serialized UI references (sliders, inputs, previews). |
void UpdateCursor() | Refreshes cursor visuals using the current contrast mode. |
See the Code Examples for step-by-step usage patterns.