Color Palettes
Color Palettes let you generate and use curated sets of colors with the Color Picker. Palettes are ScriptableObjects that can be created, configured, and consumed at edit time or runtime. The generator supports layout presets, per-handle overrides, and smarter texture sizing so palette assets stay lightweight and ready for UI sampling.
Creating a Palette Asset
- Project window → Create → XDPaint → Color Palette.
- Select the asset to see the inspector with these sections:
Base Settings
- Name: Optional label for the palette
- Palette Type: Choose from color harmony types:
- Complementary: Two colors opposite on the color wheel (180° apart)
- Triadic: Three colors evenly spaced on the color wheel (120° apart)
- Tetradic: Four colors evenly spaced on the color wheel (90° apart)
- Analogous: Colors adjacent on the color wheel (typically 30° apart)
- Split Complementary: Base color plus two colors adjacent to its complement
- Monochromatic: Different shades and tints of a single hue
- Gradient: Smooth gradient interpolation between colors
- Custom: Manually defined custom colors
- Base Colors: Input colors for generation (only shown for Custom, Gradient, Monochromatic, and Analogous types)
Generation Settings (Foldout)
- Color Count: Number of colors to generate (fixed for some harmony types)
- Generation Parameters (vary by palette type):
- Saturation Range/Variation: Variation in saturation across the palette
- Lightness Range/Variation: Variation in lightness/value across the palette
- Color Spacing: Degrees between adjacent colors (Analogous only)
- Hue Rotation: Additional hue rotation across gradient (Gradient only)
- Use Generated as Custom: Button to convert generated colors to a Custom palette
Generated Colors (Foldout)
- Visual color swatches (clickable for detailed color info)
- Color Values array (read-only)
Texture Settings (Foldout)
- Layout: Horizontal, Vertical, Grid, Radial, or Smooth arrangement
- Smooth Transitions: Enable smooth interpolation between colors
- Auto Size: Automatically determine texture dimensions
- Width/Height: Manual dimensions (when Auto Size is off)
- Rotation: 0°, 90°, 180°, or 270° rotation options
- Texture Preview: Visual preview with size info
- Generated Texture: Reference to the texture asset
The inspector automatically regenerates the palette when you change settings - no manual rebuild needed.
Using with ColorPickerManager
- Assign the palette to
ColorPickerManager → Palette Settings → Color Palette
. - Set the mode to Palette via inspector or script.
paletteManager.SetMode(ChromaPaletteMode.Palette);
You can refine sampling behaviour (bicubic, snap cursor, ignore transparent/colors) on the manager's Palette Settings.
Notes
- Palettes regenerate automatically on changes; no manual button is required.
- Generated texture is cached and rebuilt as needed.
- Works in both Editor and at runtime.