@trishchuk/coolors-mcp 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.md +20 -8
- package/.github/ISSUE_TEMPLATE/feature_request.md +22 -8
- package/.github/pull_request_template.md +33 -8
- package/.github/workflows/ci.yml +107 -104
- package/.github/workflows/deploy-docs.yml +14 -11
- package/.github/workflows/release.yml +25 -23
- package/README.md +149 -15
- package/dist/bin/server.js +997 -256
- package/dist/bin/server.js.map +1 -1
- package/dist/{chunk-P3ARRKLS.js → chunk-HOMDMKUY.js} +3 -1
- package/dist/{chunk-P3ARRKLS.js.map → chunk-HOMDMKUY.js.map} +1 -1
- package/dist/{chunk-IQ7NN26V.js → chunk-LHW2ZTOU.js} +14 -2
- package/dist/chunk-LHW2ZTOU.js.map +1 -0
- package/dist/color/index.js +1 -1
- package/dist/coolors-mcp.d.ts +4 -4
- package/dist/coolors-mcp.js +1 -1
- package/docs/.vitepress/components/ClientGrid.vue +9 -3
- package/docs/.vitepress/components/CodeBlock.vue +51 -44
- package/docs/.vitepress/components/ConfigModal.vue +151 -67
- package/docs/.vitepress/components/DiagramModal.vue +186 -154
- package/docs/.vitepress/components/TroubleshootingModal.vue +101 -96
- package/docs/.vitepress/config.js +171 -141
- package/docs/.vitepress/theme/FundingLayout.vue +65 -54
- package/docs/.vitepress/theme/Layout.vue +21 -21
- package/docs/.vitepress/theme/components/AdBanner.vue +73 -52
- package/docs/.vitepress/theme/components/AdPlaceholder.vue +3 -3
- package/docs/.vitepress/theme/components/FundingEffects.vue +77 -53
- package/docs/.vitepress/theme/components/FundingHero.vue +78 -63
- package/docs/.vitepress/theme/components/SupportSection.vue +106 -89
- package/docs/.vitepress/theme/custom-app.css +19 -12
- package/docs/.vitepress/theme/custom.css +33 -25
- package/docs/.vitepress/theme/index.js +19 -16
- package/docs/concepts/accessibility.md +59 -47
- package/docs/concepts/color-spaces.md +28 -6
- package/docs/concepts/distance-metrics.md +45 -30
- package/docs/concepts/hct.md +30 -27
- package/docs/concepts/image-analysis.md +52 -21
- package/docs/concepts/material-design.md +43 -17
- package/docs/concepts/theme-matching.md +64 -40
- package/docs/examples/basic-colors.md +92 -108
- package/docs/examples/creating-themes.md +104 -108
- package/docs/examples/css-refactoring.md +33 -29
- package/docs/examples/image-extraction.md +145 -138
- package/docs/getting-started.md +45 -34
- package/docs/index.md +5 -1
- package/docs/installation.md +15 -1
- package/docs/tools/accessibility.md +74 -68
- package/docs/tools/image-extraction.md +62 -54
- package/docs/tools/theme-matching.md +45 -42
- package/eslint.config.ts +13 -0
- package/jsr.json +1 -1
- package/package.json +17 -13
- package/src/bin/server.ts +13 -1
- package/src/color/__tests__/extract-colors.test.ts +20 -30
- package/src/color/apca.ts +105 -0
- package/src/color/color-blindness.ts +109 -0
- package/src/coolors-mcp.ts +1 -1
- package/src/session.ts +10 -2
- package/src/theme/matcher.ts +1 -1
- package/src/theme/refactor.ts +1 -1
- package/src/theme/types.ts +3 -0
- package/src/tools/__tests__/cohesion.test.ts +97 -0
- package/src/tools/__tests__/color-blindness.test.ts +45 -0
- package/src/tools/__tests__/color-conversion.test.ts +38 -0
- package/src/tools/__tests__/contrast-checker.test.ts +56 -0
- package/src/tools/__tests__/palette-export.test.ts +54 -0
- package/src/tools/adjust-color.tool.ts +80 -0
- package/src/tools/cohesion.tools.ts +380 -0
- package/src/tools/color-blindness.tool.ts +168 -0
- package/src/tools/color-conversion.tool.ts +1 -1
- package/src/tools/contrast-checker.tool.ts +53 -14
- package/src/tools/dislike-analyzer.tool.ts +41 -54
- package/src/tools/image-extraction.tools.ts +62 -115
- package/src/tools/index.ts +15 -2
- package/src/tools/palette-export.tool.ts +174 -0
- package/src/tools/palette-with-locks.tool.ts +8 -6
- package/src/types.ts +2 -3
- package/tsconfig.json +12 -2
- package/vitest.config.js +1 -3
- package/.claude/settings.local.json +0 -39
- package/.env +0 -2
- package/.mcp.json +0 -12
- package/CLAUDE.md +0 -201
- package/DOCUMENTATION.md +0 -274
- package/GEMINI.md +0 -54
- package/demo/content_based_color.png +0 -0
- package/demo/music-player.html +0 -621
- package/demo/podcast-player.html +0 -903
- package/dist/chunk-IQ7NN26V.js.map +0 -1
- package/docs/.vitepress/cache/deps/@braintree_sanitize-url.js +0 -93
- package/docs/.vitepress/cache/deps/@braintree_sanitize-url.js.map +0 -7
- package/docs/.vitepress/cache/deps/_metadata.json +0 -127
- package/docs/.vitepress/cache/deps/chunk-BUSYA2B4.js +0 -9
- package/docs/.vitepress/cache/deps/chunk-BUSYA2B4.js.map +0 -7
- package/docs/.vitepress/cache/deps/chunk-JD3CXNQ6.js +0 -12683
- package/docs/.vitepress/cache/deps/chunk-JD3CXNQ6.js.map +0 -7
- package/docs/.vitepress/cache/deps/chunk-SYPOPCWC.js +0 -9719
- package/docs/.vitepress/cache/deps/chunk-SYPOPCWC.js.map +0 -7
- package/docs/.vitepress/cache/deps/cytoscape-cose-bilkent.js +0 -4710
- package/docs/.vitepress/cache/deps/cytoscape-cose-bilkent.js.map +0 -7
- package/docs/.vitepress/cache/deps/cytoscape.js +0 -30278
- package/docs/.vitepress/cache/deps/cytoscape.js.map +0 -7
- package/docs/.vitepress/cache/deps/dayjs.js +0 -285
- package/docs/.vitepress/cache/deps/dayjs.js.map +0 -7
- package/docs/.vitepress/cache/deps/debug.js +0 -468
- package/docs/.vitepress/cache/deps/debug.js.map +0 -7
- package/docs/.vitepress/cache/deps/package.json +0 -3
- package/docs/.vitepress/cache/deps/prismjs.js +0 -1466
- package/docs/.vitepress/cache/deps/prismjs.js.map +0 -7
- package/docs/.vitepress/cache/deps/prismjs_components_prism-bash.js +0 -228
- package/docs/.vitepress/cache/deps/prismjs_components_prism-bash.js.map +0 -7
- package/docs/.vitepress/cache/deps/prismjs_components_prism-javascript.js +0 -142
- package/docs/.vitepress/cache/deps/prismjs_components_prism-javascript.js.map +0 -7
- package/docs/.vitepress/cache/deps/prismjs_components_prism-json.js +0 -27
- package/docs/.vitepress/cache/deps/prismjs_components_prism-json.js.map +0 -7
- package/docs/.vitepress/cache/deps/prismjs_components_prism-python.js +0 -65
- package/docs/.vitepress/cache/deps/prismjs_components_prism-python.js.map +0 -7
- package/docs/.vitepress/cache/deps/prismjs_components_prism-typescript.js +0 -53
- package/docs/.vitepress/cache/deps/prismjs_components_prism-typescript.js.map +0 -7
- package/docs/.vitepress/cache/deps/prismjs_components_prism-yaml.js +0 -73
- package/docs/.vitepress/cache/deps/prismjs_components_prism-yaml.js.map +0 -7
- package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +0 -4507
- package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +0 -7
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +0 -584
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +0 -7
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js +0 -1146
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js.map +0 -7
- package/docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js +0 -1667
- package/docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js.map +0 -7
- package/docs/.vitepress/cache/deps/vitepress___minisearch.js +0 -1814
- package/docs/.vitepress/cache/deps/vitepress___minisearch.js.map +0 -7
- package/docs/.vitepress/cache/deps/vue.js +0 -344
- package/docs/.vitepress/cache/deps/vue.js.map +0 -7
- package/examples/theme-matching.md +0 -113
- package/mcp-config.json +0 -8
- package/note.md +0 -35
- package/research_results.md +0 -53
- package/src/tools/colors.ts +0 -31
- package/src/tools/registry.ts +0 -142
- package/src/tools/simple-tools.ts +0 -37
package/README.md
CHANGED
|
@@ -15,20 +15,51 @@ Advanced color operations MCP server with Material Design 3 support, CSS theme m
|
|
|
15
15
|
- 🌈 **Advanced Palette Generation** - Create palettes with locked colors
|
|
16
16
|
- 🎨 **Gradient Generation** - Smooth gradients with multiple interpolation methods
|
|
17
17
|
- 🚫 **Dislike Analysis** - Detect and fix universally disliked colors
|
|
18
|
+
- 👁️ **Color-Blindness Simulation** - Brettel/Machado matrices for protan/deutan/tritan + accessibility audit
|
|
19
|
+
- 🆎 **APCA Contrast** - WCAG 3 draft contrast (Lc) alongside classic WCAG 2.x ratio
|
|
20
|
+
- 🎚️ **Tonal Scales & State Colors** - Tailwind-style 50–950 scales and hover/active/focus/disabled variants in HCT
|
|
21
|
+
- 🧬 **Palette Cohesion Score** - Quantify visual unity (tone / chroma / hue harmony) with targeted fix suggestions
|
|
22
|
+
- 🪪 **Semantic Palettes** - One brand color → primary/secondary/tertiary + success/warning/error/info in a unified family
|
|
23
|
+
- 📦 **Palette Export** - CSS custom properties, SCSS, Tailwind config, W3C design tokens, JSON
|
|
18
24
|
|
|
19
25
|
## Installation
|
|
20
26
|
|
|
27
|
+
### Method 1: NPX (Recommended)
|
|
28
|
+
|
|
29
|
+
No installation needed - runs directly:
|
|
30
|
+
|
|
31
|
+
#### Claude Desktop Configuration
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"mcpServers": {
|
|
36
|
+
"coolors": {
|
|
37
|
+
"command": "npx",
|
|
38
|
+
"args": ["-y", "@trishchuk/coolors-mcp"]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
#### Claude Code Configuration
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
claude mcp add coolors --npm-package @trishchuk/coolors-mcp
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Method 2: NPM Install
|
|
51
|
+
|
|
21
52
|
```bash
|
|
22
53
|
npm install @trishchuk/coolors-mcp
|
|
23
54
|
```
|
|
24
55
|
|
|
25
|
-
|
|
56
|
+
### Method 3: From Source
|
|
26
57
|
|
|
27
58
|
```bash
|
|
28
59
|
git clone https://github.com/x51xxx/coolors-mcp
|
|
29
60
|
cd coolors-mcp
|
|
30
|
-
|
|
31
|
-
|
|
61
|
+
pnpm install
|
|
62
|
+
pnpm run build
|
|
32
63
|
```
|
|
33
64
|
|
|
34
65
|
## Quick Start
|
|
@@ -89,14 +120,28 @@ Calculate perceptual distance between colors.
|
|
|
89
120
|
|
|
90
121
|
#### `check_contrast`
|
|
91
122
|
|
|
92
|
-
Check WCAG
|
|
123
|
+
Check contrast between two colors. Supports the WCAG 2.x luminance ratio (default), APCA Lc (WCAG 3 draft), or both side-by-side.
|
|
93
124
|
|
|
94
125
|
```typescript
|
|
95
126
|
{
|
|
96
127
|
"foreground": "#000000",
|
|
97
|
-
"background": "#ffffff"
|
|
128
|
+
"background": "#ffffff",
|
|
129
|
+
"algorithm": "both" // "wcag" (default) | "apca" | "both"
|
|
130
|
+
}
|
|
131
|
+
// Output: WCAG 21.00:1 + APCA Lc 106.0
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### `adjust_color`
|
|
135
|
+
|
|
136
|
+
Lighten / darken / saturate / desaturate / grayscale / invert / mix a color.
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
{
|
|
140
|
+
"color": "#6750a4",
|
|
141
|
+
"operation": "mix",
|
|
142
|
+
"with": "#ff6b6b",
|
|
143
|
+
"amount": 0.5 // weight (0-1) for mix, percent (0-100) for the others
|
|
98
144
|
}
|
|
99
|
-
// Output: Contrast Ratio: 21.00:1 ✓ WCAG AAA
|
|
100
145
|
```
|
|
101
146
|
|
|
102
147
|
### Palette Generation
|
|
@@ -247,6 +292,93 @@ Generate Material Design theme from image colors.
|
|
|
247
292
|
}
|
|
248
293
|
```
|
|
249
294
|
|
|
295
|
+
### Visual Cohesion
|
|
296
|
+
|
|
297
|
+
#### `generate_tonal_scale`
|
|
298
|
+
|
|
299
|
+
Build a Tailwind-style 50/100/.../900/950 scale from one seed color. Uses HCT so steps are perceptually even regardless of hue.
|
|
300
|
+
|
|
301
|
+
```typescript
|
|
302
|
+
{
|
|
303
|
+
"seed": "#6750a4",
|
|
304
|
+
"name": "brand", // CSS variable base name
|
|
305
|
+
"chromaBoost": 1, // multiplier on seed chroma
|
|
306
|
+
"stops": [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950]
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
#### `generate_state_colors`
|
|
311
|
+
|
|
312
|
+
Derive interaction states (hover/active/pressed/focus/disabled/selected) from a base color with consistent tonal deltas.
|
|
313
|
+
|
|
314
|
+
```typescript
|
|
315
|
+
{
|
|
316
|
+
"base": "#6750a4",
|
|
317
|
+
"isDark": false // true to lighten on hover instead of darkening
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
#### `analyze_palette_consistency`
|
|
322
|
+
|
|
323
|
+
Score visual cohesion of a palette: tonal step uniformity, chroma spread, hue harmony, plus a single 0–100 score and targeted suggestions.
|
|
324
|
+
|
|
325
|
+
```typescript
|
|
326
|
+
{
|
|
327
|
+
"colors": ["#6750a4", "#7f67be", "#a48dc8", "#ff0000"]
|
|
328
|
+
}
|
|
329
|
+
// Output: cohesion 77/100 + outlier #ff0000 (chroma 105 vs avg 60)
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
#### `generate_semantic_palette`
|
|
333
|
+
|
|
334
|
+
From one brand color, generate primary/secondary/tertiary + success/warning/error/info with normalized chroma & tone so every color feels like part of the same family.
|
|
335
|
+
|
|
336
|
+
```typescript
|
|
337
|
+
{
|
|
338
|
+
"brand": "#6750a4",
|
|
339
|
+
"isDark": false
|
|
340
|
+
}
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### Accessibility & Color Blindness
|
|
344
|
+
|
|
345
|
+
#### `simulate_color_blindness`
|
|
346
|
+
|
|
347
|
+
Simulate how colors appear to viewers with protanopia / deuteranopia / tritanopia (and the milder anomaly forms, plus achromatopsia). Uses Machado-style linear-sRGB confusion-line matrices.
|
|
348
|
+
|
|
349
|
+
```typescript
|
|
350
|
+
{
|
|
351
|
+
"colors": ["#e63946", "#2a9d8f"],
|
|
352
|
+
"types": ["protanopia", "deuteranopia"] // optional, defaults to all 7
|
|
353
|
+
}
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
#### `check_palette_accessibility`
|
|
357
|
+
|
|
358
|
+
Audit a palette for color-blind friendliness — flags pairs of colors that become indistinguishable under each CVD type.
|
|
359
|
+
|
|
360
|
+
```typescript
|
|
361
|
+
{
|
|
362
|
+
"colors": ["#e63946", "#2a9d8f", "#264653", "#f4a261"],
|
|
363
|
+
"indistinguishableThreshold": 10 // ΔE2000 below which colors collide
|
|
364
|
+
}
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### Palette Export
|
|
368
|
+
|
|
369
|
+
#### `export_palette`
|
|
370
|
+
|
|
371
|
+
Export a palette as CSS custom properties, SCSS variables, a Tailwind config snippet, W3C design tokens, or JSON.
|
|
372
|
+
|
|
373
|
+
```typescript
|
|
374
|
+
{
|
|
375
|
+
"colors": ["#fef3c7", "#fde68a", "#fcd34d"],
|
|
376
|
+
"format": "tailwind", // "css" | "scss" | "tailwind" | "tokens" | "json"
|
|
377
|
+
"prefix": "amber",
|
|
378
|
+
"names": ["50", "100", "200"] // optional, default uses 50/100…900 scale
|
|
379
|
+
}
|
|
380
|
+
```
|
|
381
|
+
|
|
250
382
|
### Color Psychology
|
|
251
383
|
|
|
252
384
|
#### `analyze_color_likability`
|
|
@@ -307,21 +439,23 @@ Multi-factor scoring system:
|
|
|
307
439
|
|
|
308
440
|
## Development
|
|
309
441
|
|
|
442
|
+
This project uses [pnpm](https://pnpm.io). Install it once with `npm i -g pnpm` or `corepack enable`.
|
|
443
|
+
|
|
310
444
|
```bash
|
|
311
445
|
# Install dependencies
|
|
312
|
-
|
|
446
|
+
pnpm install
|
|
313
447
|
|
|
314
448
|
# Build the project
|
|
315
|
-
|
|
449
|
+
pnpm run build
|
|
316
450
|
|
|
317
451
|
# Run tests
|
|
318
|
-
|
|
452
|
+
pnpm test
|
|
319
453
|
|
|
320
454
|
# Format code
|
|
321
|
-
|
|
455
|
+
pnpm run format
|
|
322
456
|
|
|
323
457
|
# Lint
|
|
324
|
-
|
|
458
|
+
pnpm run lint
|
|
325
459
|
```
|
|
326
460
|
|
|
327
461
|
## Architecture
|
|
@@ -385,13 +519,13 @@ Create smooth, perceptually uniform gradients for modern UIs.
|
|
|
385
519
|
|
|
386
520
|
Contributions welcome! Please ensure:
|
|
387
521
|
|
|
388
|
-
- Tests pass (`
|
|
389
|
-
- Code is formatted (`
|
|
390
|
-
- Type checking passes (`
|
|
522
|
+
- Tests pass (`pnpm test`)
|
|
523
|
+
- Code is formatted (`pnpm run format`)
|
|
524
|
+
- Type checking passes (`pnpm run lint`)
|
|
391
525
|
|
|
392
526
|
## License
|
|
393
527
|
|
|
394
|
-
MIT
|
|
528
|
+
MIT © [Taras Trishchuk](https://trishchuk.com)
|
|
395
529
|
|
|
396
530
|
## Credits
|
|
397
531
|
|