Color Theory Sandbox

Create, test, and visualize color palettes in real time using interactive color theory tools. Experiment with harmony rules, gradients, contrast, saturation, and accessibility to better understand color relationships in design.

Color Theory Sandbox

Interactive color wheel, harmony rules, and palette querying. Pick a color, explore harmonies, and query color data with JavaScript expressions.

Color Wheel Picker
Hex: #ff5733
RGB: rgb(255,87,51)
HSL: hsl(10,100%,60%)
Color Harmonies
Color Query Expression
Query palette array using JS
Examples: map to hex bright colors sort by luminance avg luminance
0 Query Results
0 ms
0 Palette Size
Base Color: #ff5733
Harmony Mode: Complementary
WCAG Contrast: --
Avg Saturation: 0%
Avg Luminance: 0%
Colorfulness: --

Query results will appear here. Execute a query on the current palette.


Why Use Color Theory Sandbox?

Color Harmonies

Generate complementary, triadic, analogous schemes instantly from any base color.

Data-Driven Queries

Use JavaScript expressions to filter, map, and analyze colors by luminance, saturation, hue.

WCAG Contrast

Check contrast ratios between base and harmony colors for accessibility.

Export & Copy

Copy palettes as hex codes, JSON, and reuse across design projects.

How Our Color Sandbox Works

The sandbox uses chroma.js for accurate color conversions. Pick any hue from the interactive color wheel, and harmony rules generate a coherent palette. Each color in the palette is exposed as an object with helper methods.

Available Color Methods in Queries:

  • color.hex() - Returns hex string (e.g., "#ff5733")
  • color.rgb() - Returns [r,g,b] array
  • color.hsl() - Returns [hue, sat, light]
  • color.luminance() - Returns brightness (0-1)
  • color.saturation() - Returns saturation (0-1)
  • color.hue() - Returns hue angle (0-360)

Query Examples:

  • palette.filter(c => c.luminance() > 0.6) → Get bright colors
  • palette.map(c => ({hex:c.hex(), lum:c.luminance()})) → Transform structure
  • palette.sort((a,b) => a.saturation() - b.saturation()) → Sort by saturation