Generate balanced light & dark themes programmatically using OKLCH color science.
Perceptually uniform colors for consistent, balanced themes.
Every request returns perfectly matched light & dark variants.
Complete design system tokens ready for production.
Export to CSS, SCSS, LESS, Tailwind, or JSON.
https://taichi.bucaastudio.com/api
Generate balanced light and dark themes using color harmony theory.
| Parameter | Type | Description |
|---|---|---|
| style | string |
Harmony mode: random, analogous, complementary, triadic, etc.
|
| baseColor | string? | Hex color seed, e.g. #3B82F6 |
| saturation | number? | -5 to 5. Adjust color vibrancy. |
| contrast | number? | -5 to 5. Adjust light/dark separation. |
| brightness | number? | -5 to 5. Global lightness shift. |
curl -X POST https://taichi.bucaastudio.com/api/generate-theme \
-H "Content-Type: application/json" \
-d '{
"style": "analogous",
"baseColor": "#3B82F6",
"saturation": 2
}'
{
"success": true,
"light": { "bg": "#f4f5f9", "primary": "#3d6fc2", ... },
"dark": { "bg": "#0a0b0d", "primary": "#5e8ad4", ... },
"metadata": {
"style": "analogous",
"seed": "#3B82F6",
"colorSpace": "OKLCH",
"philosophy": "Harmony found in nature..."
}
}
Convert a theme object to CSS, SCSS, LESS, Tailwind, or JSON format.
| Parameter | Type | Description |
|---|---|---|
| theme | object | Theme tokens object (from generate-theme) |
| format | string |
css, scss, less, tailwind, json
|
| options.prefix | string? | Variable prefix (default: taichi) |
curl -X POST https://taichi.bucaastudio.com/api/export-theme \
-H "Content-Type: application/json" \
-d '{
"theme": { "primary": "#3B82F6", "bg": "#F8FAFC", ... },
"format": "css",
"options": { "prefix": "my-app" }
}'
Each theme includes these tokens for both light and dark modes:
| Style | Description |
|---|---|
random |
Randomly chosen harmony mode |
monochrome |
Single hue with varied lightness |
analogous |
Adjacent colors on the wheel |
complementary |
Opposite colors for high contrast |
split-complementary |
Base + two adjacent to complement |
triadic |
Three evenly spaced colors |
tetradic |
Four colors in rectangular pattern |
compound |
Complement + two adjacent |
triadic-split |
Wide dynamic palette |
| Code | Description |
|---|---|
| METHOD_NOT_ALLOWED | Wrong HTTP method (use POST) |
| RATE_LIMIT_EXCEEDED | Too many requests, wait and retry |
| INVALID_STYLE | Unknown harmony style |
| INVALID_PARAMETERS | Values outside -5 to 5 range |
| INVALID_BASE_COLOR | Invalid hex color format |
| INVALID_THEME | Missing or malformed theme object |
| INVALID_FORMAT | Unknown export format |
All endpoints support CORS with Access-Control-Allow-Origin: *, allowing direct browser
requests.