@trishchuk/coolors-mcp 1.0.0 → 1.0.1
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/.claude/settings.local.json +2 -6
- 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 +97 -97
- package/.github/workflows/deploy-docs.yml +9 -9
- package/.github/workflows/release.yml +15 -15
- package/README.md +26 -1
- package/TOOLS_UK.md +233 -0
- package/docs/.vitepress/cache/deps/@braintree_sanitize-url.js +30 -12
- package/docs/.vitepress/cache/deps/_metadata.json +1 -1
- package/docs/.vitepress/cache/deps/chunk-BUSYA2B4.js +9 -6
- package/docs/.vitepress/cache/deps/chunk-JD3CXNQ6.js +2543 -1612
- package/docs/.vitepress/cache/deps/chunk-SYPOPCWC.js +3508 -2529
- package/docs/.vitepress/cache/deps/cytoscape-cose-bilkent.js +1902 -1003
- package/docs/.vitepress/cache/deps/cytoscape.js +13303 -7347
- package/docs/.vitepress/cache/deps/dayjs.js +494 -272
- package/docs/.vitepress/cache/deps/debug.js +82 -38
- package/docs/.vitepress/cache/deps/prismjs.js +444 -272
- package/docs/.vitepress/cache/deps/prismjs_components_prism-bash.js +80 -73
- package/docs/.vitepress/cache/deps/prismjs_components_prism-javascript.js +93 -62
- package/docs/.vitepress/cache/deps/prismjs_components_prism-json.js +13 -13
- package/docs/.vitepress/cache/deps/prismjs_components_prism-python.js +34 -27
- package/docs/.vitepress/cache/deps/prismjs_components_prism-typescript.js +20 -17
- package/docs/.vitepress/cache/deps/prismjs_components_prism-yaml.js +75 -41
- package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +2005 -1438
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +2 -2
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js +566 -229
- package/docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js +382 -270
- package/docs/.vitepress/cache/deps/vitepress___minisearch.js +334 -125
- package/docs/.vitepress/cache/deps/vue.js +2 -2
- 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/note.md +1 -2
- package/package.json +2 -2
|
@@ -8,24 +8,24 @@ Find the closest matching theme variable for a given color.
|
|
|
8
8
|
|
|
9
9
|
### Parameters
|
|
10
10
|
|
|
11
|
-
| Parameter
|
|
12
|
-
|
|
13
|
-
| `color`
|
|
14
|
-
| `themeCSS`
|
|
15
|
-
| `context`
|
|
16
|
-
| `minConfidence` | number | ❌
|
|
11
|
+
| Parameter | Type | Required | Description |
|
|
12
|
+
| --------------- | ------ | -------- | ------------------------------------------------------------------- |
|
|
13
|
+
| `color` | string | ✅ | Color to match (hex, rgb, hsl) |
|
|
14
|
+
| `themeCSS` | string | ✅ | CSS containing theme variables |
|
|
15
|
+
| `context` | string | ❌ | Usage context: text, background, border, shadow, accent, decorative |
|
|
16
|
+
| `minConfidence` | number | ❌ | Minimum confidence threshold (0-100, default: 70) |
|
|
17
17
|
|
|
18
18
|
### Returns
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
21
|
{
|
|
22
|
-
match: string;
|
|
23
|
-
confidence: number;
|
|
22
|
+
match: string; // CSS variable name
|
|
23
|
+
confidence: number; // Confidence score (0-100)
|
|
24
24
|
originalColor: string; // Input color
|
|
25
|
-
themeColor: string;
|
|
26
|
-
distance: number;
|
|
25
|
+
themeColor: string; // Matched theme color
|
|
26
|
+
distance: number; // Perceptual distance
|
|
27
27
|
semantic: {
|
|
28
|
-
role: string;
|
|
28
|
+
role: string; // Detected semantic role
|
|
29
29
|
compatible: boolean; // Context compatibility
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -117,13 +117,13 @@ Automatically replace hardcoded colors with theme variables in CSS.
|
|
|
117
117
|
|
|
118
118
|
### Parameters
|
|
119
119
|
|
|
120
|
-
| Parameter
|
|
121
|
-
|
|
122
|
-
| `css`
|
|
123
|
-
| `themeCSS`
|
|
124
|
-
| `minConfidence`
|
|
125
|
-
| `preserveOriginal` | boolean | ❌
|
|
126
|
-
| `generateReport`
|
|
120
|
+
| Parameter | Type | Required | Description |
|
|
121
|
+
| ------------------ | ------- | -------- | ----------------------------------------------------- |
|
|
122
|
+
| `css` | string | ✅ | CSS content to refactor |
|
|
123
|
+
| `themeCSS` | string | ✅ | CSS containing theme variables |
|
|
124
|
+
| `minConfidence` | number | ❌ | Minimum confidence for replacements (default: 70) |
|
|
125
|
+
| `preserveOriginal` | boolean | ❌ | Keep original values as comments (default: true) |
|
|
126
|
+
| `generateReport` | boolean | ❌ | Generate detailed refactoring report (default: false) |
|
|
127
127
|
|
|
128
128
|
### Returns
|
|
129
129
|
|
|
@@ -236,26 +236,26 @@ Match multiple colors to theme variables in a single operation.
|
|
|
236
236
|
|
|
237
237
|
### Parameters
|
|
238
238
|
|
|
239
|
-
| Parameter
|
|
240
|
-
|
|
241
|
-
| `colors`
|
|
242
|
-
| `themeCSS` | string
|
|
243
|
-
| `context`
|
|
239
|
+
| Parameter | Type | Required | Description |
|
|
240
|
+
| ---------- | -------- | -------- | --------------------------------- |
|
|
241
|
+
| `colors` | string[] | ✅ | Array of colors to match (max 50) |
|
|
242
|
+
| `themeCSS` | string | ✅ | CSS containing theme variables |
|
|
243
|
+
| `context` | string | ❌ | Usage context for all colors |
|
|
244
244
|
|
|
245
245
|
### Returns
|
|
246
246
|
|
|
247
247
|
```typescript
|
|
248
248
|
{
|
|
249
249
|
matches: Array<{
|
|
250
|
-
color: string;
|
|
250
|
+
color: string; // Input color
|
|
251
251
|
match: string | null; // Matched variable or null
|
|
252
|
-
confidence: number;
|
|
253
|
-
distance: number;
|
|
252
|
+
confidence: number; // Match confidence
|
|
253
|
+
distance: number; // Perceptual distance
|
|
254
254
|
}>;
|
|
255
255
|
summary: {
|
|
256
|
-
total: number;
|
|
257
|
-
matched: number;
|
|
258
|
-
unmatched: number;
|
|
256
|
+
total: number; // Total colors processed
|
|
257
|
+
matched: number; // Successfully matched
|
|
258
|
+
unmatched: number; // No suitable match
|
|
259
259
|
averageConfidence: number;
|
|
260
260
|
}
|
|
261
261
|
}
|
|
@@ -335,11 +335,11 @@ Generate CSS custom properties for a complete theme from a source color.
|
|
|
335
335
|
|
|
336
336
|
### Parameters
|
|
337
337
|
|
|
338
|
-
| Parameter
|
|
339
|
-
|
|
340
|
-
| `sourceColor`
|
|
341
|
-
| `prefix`
|
|
342
|
-
| `includeTones` | number[] | ❌
|
|
338
|
+
| Parameter | Type | Required | Description |
|
|
339
|
+
| -------------- | -------- | -------- | ------------------------------------------------------- |
|
|
340
|
+
| `sourceColor` | string | ✅ | Source color for theme generation |
|
|
341
|
+
| `prefix` | string | ❌ | Prefix for CSS variables (default: "color") |
|
|
342
|
+
| `includeTones` | number[] | ❌ | Tone values to include (default: Material Design tones) |
|
|
343
343
|
|
|
344
344
|
### Returns
|
|
345
345
|
|
|
@@ -440,11 +440,11 @@ Use clear, semantic names:
|
|
|
440
440
|
|
|
441
441
|
### Confidence Thresholds
|
|
442
442
|
|
|
443
|
-
| Use Case
|
|
444
|
-
|
|
445
|
-
| Production
|
|
446
|
-
| Development | 70-85%
|
|
447
|
-
| Exploration | 50-70%
|
|
443
|
+
| Use Case | Recommended | Rationale |
|
|
444
|
+
| ----------- | ----------- | ------------------------- |
|
|
445
|
+
| Production | 85-100% | Avoid false matches |
|
|
446
|
+
| Development | 70-85% | Balance accuracy/coverage |
|
|
447
|
+
| Exploration | 50-70% | Find possibilities |
|
|
448
448
|
|
|
449
449
|
### Performance Tips
|
|
450
450
|
|
|
@@ -466,7 +466,7 @@ if (result.confidence < minConfidence) {
|
|
|
466
466
|
try {
|
|
467
467
|
const refactored = await refactorCSS(css, theme);
|
|
468
468
|
} catch (error) {
|
|
469
|
-
console.error(
|
|
469
|
+
console.error("Invalid CSS:", error);
|
|
470
470
|
}
|
|
471
471
|
```
|
|
472
472
|
|
|
@@ -498,7 +498,7 @@ if (!result) {
|
|
|
498
498
|
const colors = extractThemeColors(themeCSS);
|
|
499
499
|
const unique = new Set(colors.values());
|
|
500
500
|
if (unique.size < colors.size) {
|
|
501
|
-
console.warn(
|
|
501
|
+
console.warn("Duplicate colors in theme");
|
|
502
502
|
}
|
|
503
503
|
```
|
|
504
504
|
|
|
@@ -524,6 +524,7 @@ const refactored = refactorWithTheme(css, theme);
|
|
|
524
524
|
|
|
525
525
|
**Problem**: All matches have low confidence
|
|
526
526
|
**Solution**:
|
|
527
|
+
|
|
527
528
|
- Check theme has enough color variations
|
|
528
529
|
- Lower minConfidence threshold
|
|
529
530
|
- Add more theme variables
|
|
@@ -532,6 +533,7 @@ const refactored = refactorWithTheme(css, theme);
|
|
|
532
533
|
|
|
533
534
|
**Problem**: Colors match wrong semantic role
|
|
534
535
|
**Solution**:
|
|
536
|
+
|
|
535
537
|
- Use clearer variable naming
|
|
536
538
|
- Provide context parameter
|
|
537
539
|
- Adjust semantic weight in matching
|
|
@@ -540,6 +542,7 @@ const refactored = refactorWithTheme(css, theme);
|
|
|
540
542
|
|
|
541
543
|
**Problem**: Slow with large CSS files
|
|
542
544
|
**Solution**:
|
|
545
|
+
|
|
543
546
|
- Split CSS into smaller chunks
|
|
544
547
|
- Use batch operations
|
|
545
548
|
- Cache parsed theme variables
|
|
@@ -549,4 +552,4 @@ const refactored = refactorWithTheme(css, theme);
|
|
|
549
552
|
- [Theme Matching Concepts](../concepts/theme-matching.md) - How matching works
|
|
550
553
|
- [CSS Refactoring Examples](../examples/css-refactoring.md) - Practical examples
|
|
551
554
|
- [Material Design Tools](./material-design.md) - Theme generation
|
|
552
|
-
- [Color Operations](./color-operations.md) - Basic color tools
|
|
555
|
+
- [Color Operations](./color-operations.md) - Basic color tools
|
package/note.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trishchuk/coolors-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"main": "dist/CoolorsMCP.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"repository": {
|
|
59
59
|
"type": "git",
|
|
60
|
-
"url": "https://github.com/x51xxx/coolors-mcp"
|
|
60
|
+
"url": "git+https://github.com/x51xxx/coolors-mcp.git"
|
|
61
61
|
},
|
|
62
62
|
"homepage": "https://github.com/x51xxx/coolors-mcp",
|
|
63
63
|
"bugs": {
|