@trishchuk/coolors-mcp 1.0.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.
Files changed (197) hide show
  1. package/.claude/settings.local.json +39 -0
  2. package/.env +2 -0
  3. package/.github/ISSUE_TEMPLATE/bug_report.md +73 -0
  4. package/.github/ISSUE_TEMPLATE/feature_request.md +71 -0
  5. package/.github/pull_request_template.md +97 -0
  6. package/.github/workflows/ci.yml +127 -0
  7. package/.github/workflows/deploy-docs.yml +56 -0
  8. package/.github/workflows/release.yml +99 -0
  9. package/.mcp.json +12 -0
  10. package/.prettierignore +1 -0
  11. package/CLAUDE.md +201 -0
  12. package/DOCUMENTATION.md +274 -0
  13. package/GEMINI.md +54 -0
  14. package/LICENSE +21 -0
  15. package/README.md +401 -0
  16. package/demo/content_based_color.png +0 -0
  17. package/demo/music-player.html +621 -0
  18. package/demo/podcast-player.html +903 -0
  19. package/dist/bin/coolors-mcp.d.ts +1 -0
  20. package/dist/bin/coolors-mcp.js +154 -0
  21. package/dist/bin/coolors-mcp.js.map +1 -0
  22. package/dist/bin/server.d.ts +1 -0
  23. package/dist/bin/server.js +3292 -0
  24. package/dist/bin/server.js.map +1 -0
  25. package/dist/chunk-IQ7NN26V.js +114 -0
  26. package/dist/chunk-IQ7NN26V.js.map +1 -0
  27. package/dist/chunk-P3ARRKLS.js +1214 -0
  28. package/dist/chunk-P3ARRKLS.js.map +1 -0
  29. package/dist/color/index.d.ts +716 -0
  30. package/dist/color/index.js +153 -0
  31. package/dist/color/index.js.map +1 -0
  32. package/dist/coolors-mcp.d.ts +136 -0
  33. package/dist/coolors-mcp.js +7 -0
  34. package/dist/coolors-mcp.js.map +1 -0
  35. package/docs/.vitepress/cache/deps/@braintree_sanitize-url.js +93 -0
  36. package/docs/.vitepress/cache/deps/@braintree_sanitize-url.js.map +7 -0
  37. package/docs/.vitepress/cache/deps/_metadata.json +127 -0
  38. package/docs/.vitepress/cache/deps/chunk-BUSYA2B4.js +9 -0
  39. package/docs/.vitepress/cache/deps/chunk-BUSYA2B4.js.map +7 -0
  40. package/docs/.vitepress/cache/deps/chunk-JD3CXNQ6.js +12683 -0
  41. package/docs/.vitepress/cache/deps/chunk-JD3CXNQ6.js.map +7 -0
  42. package/docs/.vitepress/cache/deps/chunk-SYPOPCWC.js +9719 -0
  43. package/docs/.vitepress/cache/deps/chunk-SYPOPCWC.js.map +7 -0
  44. package/docs/.vitepress/cache/deps/cytoscape-cose-bilkent.js +4710 -0
  45. package/docs/.vitepress/cache/deps/cytoscape-cose-bilkent.js.map +7 -0
  46. package/docs/.vitepress/cache/deps/cytoscape.js +30278 -0
  47. package/docs/.vitepress/cache/deps/cytoscape.js.map +7 -0
  48. package/docs/.vitepress/cache/deps/dayjs.js +285 -0
  49. package/docs/.vitepress/cache/deps/dayjs.js.map +7 -0
  50. package/docs/.vitepress/cache/deps/debug.js +468 -0
  51. package/docs/.vitepress/cache/deps/debug.js.map +7 -0
  52. package/docs/.vitepress/cache/deps/package.json +3 -0
  53. package/docs/.vitepress/cache/deps/prismjs.js +1466 -0
  54. package/docs/.vitepress/cache/deps/prismjs.js.map +7 -0
  55. package/docs/.vitepress/cache/deps/prismjs_components_prism-bash.js +228 -0
  56. package/docs/.vitepress/cache/deps/prismjs_components_prism-bash.js.map +7 -0
  57. package/docs/.vitepress/cache/deps/prismjs_components_prism-javascript.js +142 -0
  58. package/docs/.vitepress/cache/deps/prismjs_components_prism-javascript.js.map +7 -0
  59. package/docs/.vitepress/cache/deps/prismjs_components_prism-json.js +27 -0
  60. package/docs/.vitepress/cache/deps/prismjs_components_prism-json.js.map +7 -0
  61. package/docs/.vitepress/cache/deps/prismjs_components_prism-python.js +65 -0
  62. package/docs/.vitepress/cache/deps/prismjs_components_prism-python.js.map +7 -0
  63. package/docs/.vitepress/cache/deps/prismjs_components_prism-typescript.js +53 -0
  64. package/docs/.vitepress/cache/deps/prismjs_components_prism-typescript.js.map +7 -0
  65. package/docs/.vitepress/cache/deps/prismjs_components_prism-yaml.js +73 -0
  66. package/docs/.vitepress/cache/deps/prismjs_components_prism-yaml.js.map +7 -0
  67. package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +4507 -0
  68. package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +7 -0
  69. package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +584 -0
  70. package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +7 -0
  71. package/docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js +1146 -0
  72. package/docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js.map +7 -0
  73. package/docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js +1667 -0
  74. package/docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js.map +7 -0
  75. package/docs/.vitepress/cache/deps/vitepress___minisearch.js +1814 -0
  76. package/docs/.vitepress/cache/deps/vitepress___minisearch.js.map +7 -0
  77. package/docs/.vitepress/cache/deps/vue.js +344 -0
  78. package/docs/.vitepress/cache/deps/vue.js.map +7 -0
  79. package/docs/.vitepress/components/ClientGrid.vue +125 -0
  80. package/docs/.vitepress/components/CodeBlock.vue +231 -0
  81. package/docs/.vitepress/components/ConfigModal.vue +477 -0
  82. package/docs/.vitepress/components/DiagramModal.vue +528 -0
  83. package/docs/.vitepress/components/TroubleshootingModal.vue +472 -0
  84. package/docs/.vitepress/config.js +162 -0
  85. package/docs/.vitepress/theme/FundingLayout.vue +251 -0
  86. package/docs/.vitepress/theme/Layout.vue +134 -0
  87. package/docs/.vitepress/theme/components/AdBanner.vue +317 -0
  88. package/docs/.vitepress/theme/components/AdPlaceholder.vue +78 -0
  89. package/docs/.vitepress/theme/components/FundingEffects.vue +322 -0
  90. package/docs/.vitepress/theme/components/FundingHero.vue +345 -0
  91. package/docs/.vitepress/theme/components/SupportSection.vue +511 -0
  92. package/docs/.vitepress/theme/custom-app.css +339 -0
  93. package/docs/.vitepress/theme/custom.css +699 -0
  94. package/docs/.vitepress/theme/index.js +25 -0
  95. package/docs/README.md +198 -0
  96. package/docs/concepts/accessibility.md +473 -0
  97. package/docs/concepts/color-spaces.md +222 -0
  98. package/docs/concepts/distance-metrics.md +384 -0
  99. package/docs/concepts/hct.md +261 -0
  100. package/docs/concepts/image-analysis.md +396 -0
  101. package/docs/concepts/material-design.md +306 -0
  102. package/docs/concepts/theme-matching.md +399 -0
  103. package/docs/examples/basic-colors.md +490 -0
  104. package/docs/examples/creating-themes.md +898 -0
  105. package/docs/examples/css-refactoring.md +824 -0
  106. package/docs/examples/image-extraction.md +882 -0
  107. package/docs/getting-started.md +366 -0
  108. package/docs/index.md +190 -0
  109. package/docs/installation.md +157 -0
  110. package/docs/tools/README.md +234 -0
  111. package/docs/tools/accessibility.md +614 -0
  112. package/docs/tools/color-operations.md +374 -0
  113. package/docs/tools/image-extraction.md +624 -0
  114. package/docs/tools/material-design.md +347 -0
  115. package/docs/tools/theme-matching.md +552 -0
  116. package/eslint.config.ts +14 -0
  117. package/examples/theme-matching.md +113 -0
  118. package/jsr.json +7 -0
  119. package/mcp-config.json +8 -0
  120. package/note.md +35 -0
  121. package/package.json +122 -0
  122. package/research_results.md +53 -0
  123. package/src/bin/coolors-mcp.ts +194 -0
  124. package/src/bin/server.ts +61 -0
  125. package/src/color/__tests__/conversions-argb.test.ts +198 -0
  126. package/src/color/__tests__/extract-colors.test.ts +360 -0
  127. package/src/color/__tests__/image-utils.test.ts +242 -0
  128. package/src/color/__tests__/reference-colors.test.ts +278 -0
  129. package/src/color/__tests__/round-trip.test.ts +197 -0
  130. package/src/color/conversions.test.ts +402 -0
  131. package/src/color/conversions.ts +393 -0
  132. package/src/color/dislike/__tests__/dislike-analyzer.test.ts +248 -0
  133. package/src/color/dislike/dislike-analyzer.ts +114 -0
  134. package/src/color/extract-colors.ts +228 -0
  135. package/src/color/hct/__tests__/hct-class.test.ts +232 -0
  136. package/src/color/hct/harmonization.ts +204 -0
  137. package/src/color/hct/hct-class.ts +109 -0
  138. package/src/color/hct/hct-solver.ts +168 -0
  139. package/src/color/hct/index.ts +39 -0
  140. package/src/color/hct/tonal-palette.ts +211 -0
  141. package/src/color/hct/types.ts +88 -0
  142. package/src/color/image-utils.ts +79 -0
  143. package/src/color/index.ts +87 -0
  144. package/src/color/material-theme.ts +157 -0
  145. package/src/color/metrics.test.ts +276 -0
  146. package/src/color/metrics.ts +281 -0
  147. package/src/color/quantize/__tests__/quantizer_celebi.test.ts +195 -0
  148. package/src/color/quantize/lab_point_provider.ts +55 -0
  149. package/src/color/quantize/point_provider.ts +27 -0
  150. package/src/color/quantize/quantizer_celebi.ts +51 -0
  151. package/src/color/quantize/quantizer_celebi_test.ts +71 -0
  152. package/src/color/quantize/quantizer_map.ts +47 -0
  153. package/src/color/quantize/quantizer_wsmeans.ts +232 -0
  154. package/src/color/quantize/quantizer_wu.ts +472 -0
  155. package/src/color/score/__tests__/score.test.ts +224 -0
  156. package/src/color/score/score.ts +175 -0
  157. package/src/color/types.ts +151 -0
  158. package/src/color/utils/color_utils.ts +292 -0
  159. package/src/color/utils/math_utils.ts +145 -0
  160. package/src/color/utils.test.ts +403 -0
  161. package/src/color/utils.ts +315 -0
  162. package/src/constants.ts +5 -0
  163. package/src/coolors-mcp.ts +37 -0
  164. package/src/examples/addition.ts +333 -0
  165. package/src/examples/color-demo.ts +125 -0
  166. package/src/examples/custom-logger.ts +201 -0
  167. package/src/examples/oauth-server.ts +113 -0
  168. package/src/examples/session-context.ts +269 -0
  169. package/src/session.ts +116 -0
  170. package/src/theme/__tests__/matcher.test.ts +180 -0
  171. package/src/theme/__tests__/parser.test.ts +148 -0
  172. package/src/theme/__tests__/refactor.test.ts +224 -0
  173. package/src/theme/index.ts +34 -0
  174. package/src/theme/matcher.ts +395 -0
  175. package/src/theme/parser.ts +392 -0
  176. package/src/theme/refactor.ts +360 -0
  177. package/src/theme/types.ts +152 -0
  178. package/src/tools/__tests__/gradient-generator.test.ts +206 -0
  179. package/src/tools/__tests__/palette-with-locks.test.ts +109 -0
  180. package/src/tools/color-conversion.tool.ts +54 -0
  181. package/src/tools/color-distance.tool.ts +41 -0
  182. package/src/tools/colors.ts +31 -0
  183. package/src/tools/contrast-checker.tool.ts +37 -0
  184. package/src/tools/dislike-analyzer.tool.ts +247 -0
  185. package/src/tools/gradient-generator.tool.ts +250 -0
  186. package/src/tools/image-extraction.tools.ts +289 -0
  187. package/src/tools/index.ts +39 -0
  188. package/src/tools/material-theme.tools.ts +250 -0
  189. package/src/tools/palette-generator.tool.ts +135 -0
  190. package/src/tools/palette-with-locks.tool.ts +221 -0
  191. package/src/tools/registry.ts +142 -0
  192. package/src/tools/simple-tools.ts +37 -0
  193. package/src/tools/theme-matching.tools.ts +334 -0
  194. package/src/types.ts +182 -0
  195. package/src/utils.ts +22 -0
  196. package/tsconfig.json +8 -0
  197. package/vitest.config.js +15 -0
@@ -0,0 +1,366 @@
1
+ # Getting Started
2
+
3
+ Get up and running with Coolors MCP in minutes. This guide covers installation, basic usage, and your first color operations.
4
+
5
+ ## Quick Start
6
+
7
+ ### 1. Install Coolors MCP
8
+
9
+ #### For Claude Code
10
+ ```bash
11
+ claude mcp add coolors -- npx -y @trishchuk/coolors-mcp
12
+ ```
13
+
14
+ #### For Claude Desktop
15
+ Add to your configuration:
16
+ ```json
17
+ {
18
+ "mcpServers": {
19
+ "coolors": {
20
+ "command": "npx",
21
+ "args": ["-y", "@trishchuk/coolors-mcp"]
22
+ }
23
+ }
24
+ }
25
+ ```
26
+
27
+ ### 2. Verify Installation
28
+
29
+ Check that Coolors MCP is available:
30
+ ```
31
+ /mcp
32
+ ```
33
+
34
+ You should see `coolors` in the list of available servers.
35
+
36
+ ### 3. Your First Color Operation
37
+
38
+ Try a simple color conversion:
39
+ ```
40
+ Convert #6366f1 to HSL format
41
+ ```
42
+
43
+ Claude will use the `convert_color` tool and return: `hsl(239, 84%, 67%)`
44
+
45
+ ## Basic Color Operations
46
+
47
+ ### Color Conversion
48
+
49
+ Convert between any supported format:
50
+
51
+ ```javascript
52
+ // Hex to RGB
53
+ "Convert #6366f1 to RGB"
54
+ // Result: rgb(99, 102, 241)
55
+
56
+ // RGB to HSL
57
+ "Convert rgb(99, 102, 241) to HSL"
58
+ // Result: hsl(239, 84%, 67%)
59
+
60
+ // HSL to LAB
61
+ "Convert hsl(239, 84%, 67%) to LAB"
62
+ // Result: lab(47.9, 35.2, -65.7)
63
+
64
+ // Any color to HCT
65
+ "Convert #6366f1 to HCT"
66
+ // Result: hct(265.8, 87.2, 47.9)
67
+ ```
68
+
69
+ ### Color Distance
70
+
71
+ Calculate perceptual difference between colors:
72
+
73
+ ```javascript
74
+ "What's the perceptual distance between #6366f1 and #5355d1?"
75
+ // Uses Delta E 2000 algorithm
76
+ // Result: 5.2 (very similar colors)
77
+
78
+ "Compare #ff0000 and #00ff00 using Delta E"
79
+ // Result: 86.6 (very different colors)
80
+ ```
81
+
82
+ ### Contrast Checking
83
+
84
+ Verify accessibility compliance:
85
+
86
+ ```javascript
87
+ "Check contrast between #1f2937 and #ffffff"
88
+ // Result: 15.74:1 - Passes AAA for all text sizes
89
+
90
+ "Is #6366f1 accessible on white background?"
91
+ // Result: 3.03:1 - Passes AA for large text only
92
+
93
+ "What text color works on #6366f1 background?"
94
+ // Result: #ffffff (white) provides 4.6:1 contrast
95
+ ```
96
+
97
+ ## Creating Color Palettes
98
+
99
+ ### Basic Palettes
100
+
101
+ Generate harmonious color sets:
102
+
103
+ ```javascript
104
+ "Create a monochromatic palette from #6366f1"
105
+ // Result: 5 shades of the same hue
106
+
107
+ "Generate complementary colors for #6366f1"
108
+ // Result: #6366f1 and its opposite
109
+
110
+ "Create a triadic color scheme from #6366f1"
111
+ // Result: 3 colors 120° apart
112
+ ```
113
+
114
+ ### Material Design Themes
115
+
116
+ Generate complete Material Design 3 themes:
117
+
118
+ ```javascript
119
+ "Create a Material Design theme from #6366f1"
120
+ // Generates:
121
+ // - Primary, secondary, tertiary palettes
122
+ // - Surface and background colors
123
+ // - Error colors
124
+ // - Light and dark variants
125
+ ```
126
+
127
+ ### Custom Gradients
128
+
129
+ Create smooth color transitions:
130
+
131
+ ```javascript
132
+ "Create a gradient from #6366f1 to #ec4899 with 10 steps"
133
+ // Result: 10 colors smoothly transitioning
134
+
135
+ "Generate a gradient using LAB interpolation"
136
+ // Result: Perceptually smooth gradient
137
+ ```
138
+
139
+ ## CSS Theme Matching
140
+
141
+ ### Finding Theme Variables
142
+
143
+ Match colors to existing CSS variables:
144
+
145
+ ```javascript
146
+ "Find the closest theme variable for #6365f0 in my CSS"
147
+ // Analyzes your theme CSS and finds best match
148
+ // Result: --color-primary-500 (99% confidence)
149
+ ```
150
+
151
+ ### Refactoring CSS
152
+
153
+ Automatically replace hardcoded colors:
154
+
155
+ ```javascript
156
+ "Refactor this CSS to use theme variables:
157
+ .button {
158
+ background: #6366f1;
159
+ border: 1px solid #4f46e5;
160
+ }"
161
+
162
+ // Result:
163
+ .button {
164
+ background: var(--color-primary-500);
165
+ border: 1px solid var(--color-primary-600);
166
+ }
167
+ ```
168
+
169
+ ## Working with Images
170
+
171
+ ### Extract Colors
172
+
173
+ Get dominant colors from images:
174
+
175
+ ```javascript
176
+ "Extract the main colors from this image"
177
+ // Analyzes image and returns:
178
+ // - Top 5 dominant colors
179
+ // - Population percentages
180
+ // - Suitability scores
181
+ ```
182
+
183
+ ### Generate Theme from Image
184
+
185
+ Create a complete theme from an image:
186
+
187
+ ```javascript
188
+ "Create a Material Design theme from this album cover"
189
+ // Extracts colors and generates:
190
+ // - Source color selection
191
+ // - Complete color scheme
192
+ // - Light/dark variants
193
+ ```
194
+
195
+ ## Common Workflows
196
+
197
+ ### 1. Building a Color System
198
+
199
+ Start with a brand color and expand:
200
+
201
+ ```javascript
202
+ // Step 1: Define primary color
203
+ "My brand color is #6366f1"
204
+
205
+ // Step 2: Generate palette
206
+ "Create a complete color system from this"
207
+
208
+ // Step 3: Check accessibility
209
+ "Verify all color combinations meet WCAG AA"
210
+
211
+ // Step 4: Export as CSS
212
+ "Generate CSS custom properties for this theme"
213
+ ```
214
+
215
+ ### 2. Migrating to Theme Variables
216
+
217
+ Convert existing CSS to use variables:
218
+
219
+ ```javascript
220
+ // Step 1: Define your theme
221
+ "Here's my theme CSS: [paste theme]"
222
+
223
+ // Step 2: Analyze existing styles
224
+ "Find all hardcoded colors in styles.css"
225
+
226
+ // Step 3: Refactor automatically
227
+ "Replace hardcoded colors with theme variables"
228
+
229
+ // Step 4: Review changes
230
+ "Show me colors that couldn't be matched"
231
+ ```
232
+
233
+ ### 3. Creating Accessible Designs
234
+
235
+ Ensure your colors meet standards:
236
+
237
+ ```javascript
238
+ // Step 1: Test current colors
239
+ "Check contrast for my primary colors"
240
+
241
+ // Step 2: Fix issues
242
+ "Adjust colors to meet WCAG AA"
243
+
244
+ // Step 3: Generate alternatives
245
+ "Create high contrast version of theme"
246
+
247
+ // Step 4: Validate
248
+ "Verify all combinations are accessible"
249
+ ```
250
+
251
+ ## Advanced Features
252
+
253
+ ### Color Harmonization
254
+
255
+ Make multiple colors work together:
256
+
257
+ ```javascript
258
+ "Harmonize these colors: #6366f1, #ec4899, #10b981"
259
+ // Adjusts colors to be more harmonious while maintaining identity
260
+ ```
261
+
262
+ ### Dislike Detection
263
+
264
+ Avoid universally disliked colors:
265
+
266
+ ```javascript
267
+ "Is #6b7c3a a good color for UI?"
268
+ // Detects "bile zone" colors and suggests alternatives
269
+ ```
270
+
271
+ ### Batch Processing
272
+
273
+ Process multiple colors efficiently:
274
+
275
+ ```javascript
276
+ "Match all these colors to my theme: [list of colors]"
277
+ // Processes all colors and returns best matches
278
+ ```
279
+
280
+ ## Tips and Tricks
281
+
282
+ ### Performance
283
+
284
+ - **Resize images** before extraction (300px width is usually enough)
285
+ - **Cache theme variables** when doing multiple matches
286
+ - **Use batch operations** when processing multiple colors
287
+
288
+ ### Accuracy
289
+
290
+ - **Use HCT** for perceptual operations
291
+ - **Use LAB** for color matching
292
+ - **Use RGB/Hex** for final output
293
+
294
+ ### Accessibility
295
+
296
+ - **Always check contrast** for text/background pairs
297
+ - **Provide high contrast options** for users who need them
298
+ - **Don't rely on color alone** to convey information
299
+
300
+ ## Next Steps
301
+
302
+ ### Learn More
303
+
304
+ - [Color Spaces](concepts/color-spaces.md) - Understand different color models
305
+ - [HCT System](concepts/hct.md) - Google's perceptual color space
306
+ - [Material Design](concepts/material-design.md) - Complete theming system
307
+ - [Accessibility](concepts/accessibility.md) - WCAG compliance
308
+
309
+ ### Explore Tools
310
+
311
+ - [Color Operations](tools/color-operations.md) - All conversion tools
312
+ - [Material Design Tools](tools/material-design.md) - Theme generation
313
+ - [Theme Matching](tools/theme-matching.md) - CSS refactoring
314
+ - [Image Extraction](tools/image-extraction.md) - Working with images
315
+
316
+ ### See Examples
317
+
318
+ - [Basic Colors](examples/basic-colors.md) - Simple operations
319
+ - [Creating Themes](examples/creating-themes.md) - Theme generation
320
+ - [CSS Refactoring](examples/css-refactoring.md) - Modernizing CSS
321
+ - [Image Extraction](examples/image-extraction.md) - Image-based themes
322
+
323
+ ## Getting Help
324
+
325
+ ### Common Issues
326
+
327
+ #### "Tool not found"
328
+ Make sure Coolors MCP is properly installed and Claude has been restarted.
329
+
330
+ #### "Invalid color format"
331
+ Check that your color is in a supported format: hex (#RRGGBB), rgb(), hsl(), etc.
332
+
333
+ #### "No theme matches found"
334
+ Lower the confidence threshold or add more theme variables.
335
+
336
+ ### Support
337
+
338
+ - **GitHub Issues**: [Report bugs](https://github.com/x51xxx/coolors-mcp/issues)
339
+ - **Documentation**: [Full docs](https://x51xxx.github.io/coolors-mcp/)
340
+ - **Examples**: [Code samples](examples/basic-colors.md)
341
+
342
+ ## Quick Reference
343
+
344
+ ### Supported Color Formats
345
+ - **Hex**: `#RRGGBB` or `#RGB`
346
+ - **RGB**: `rgb(r, g, b)` or `{r, g, b}`
347
+ - **HSL**: `hsl(h, s%, l%)` or `{h, s, l}`
348
+ - **LAB**: `lab(l, a, b)` or `{l, a, b}`
349
+ - **HCT**: `hct(h, c, t)` or `{h, c, t}`
350
+
351
+ ### Common Tools
352
+ - `convert_color` - Format conversion
353
+ - `color_distance` - Perceptual difference
354
+ - `check_contrast` - WCAG compliance
355
+ - `generate_palette` - Color schemes
356
+ - `generate_material_theme` - Material Design
357
+ - `match_theme_color` - Find CSS variables
358
+ - `refactor_css_with_theme` - Update CSS
359
+ - `extract_image_colors` - Image analysis
360
+
361
+ ### Contrast Requirements
362
+ - **Normal text**: 4.5:1 (AA), 7:1 (AAA)
363
+ - **Large text**: 3:1 (AA), 4.5:1 (AAA)
364
+ - **UI elements**: 3:1 (AA)
365
+
366
+ Ready to start? Try your first color operation above!
package/docs/index.md ADDED
@@ -0,0 +1,190 @@
1
+ ---
2
+ layout: home
3
+
4
+ hero:
5
+ name: "Coolors MCP"
6
+ text: "Advanced Color Operations for MCP"
7
+ tagline: "Professional color utilities with Material Design 3 support, CSS theme matching, image extraction, and accessibility compliance — <span style='color: #FFFFFF; background-color: #6366F1; padding: 2px 8px; border-radius: 6px; font-size: 14px; font-weight: 600; margin-left: 4px; display: inline-block; vertical-align: middle;'>built for Claude Code</span>"
8
+ actions:
9
+ - theme: brand
10
+ text: Get Started
11
+ link: /getting-started
12
+ - theme: alt
13
+ text: View on GitHub
14
+ link: https://github.com/x51xxx/coolors-mcp
15
+
16
+ features:
17
+ - icon: 🎨
18
+ title: Multi-Format Color Conversion
19
+ details: |
20
+ Convert between hex, RGB, HSL, LAB, and Google's HCT color spaces with perfect accuracy
21
+ - icon: 🎭
22
+ title: Material Design 3 Themes
23
+ details: Generate complete Material Design color systems from any source color
24
+ - icon: 🔍
25
+ title: Smart CSS Theme Matching
26
+ details: |
27
+ <span style="color: #3b82f6;">Automatically match colors to CSS variables</span><br>
28
+ <span style="color: #10b981;">with perceptual accuracy and semantic understanding</span>
29
+ - icon: 🖼️
30
+ title: Image Color Extraction
31
+ details: Extract dominant colors from images using Google's Celebi quantization algorithm
32
+ - icon: ♿
33
+ title: WCAG Accessibility
34
+ details: Check contrast ratios and ensure your color choices meet accessibility standards
35
+ - icon: 🚀
36
+ title: HCT Color Space
37
+ details: Use Google's perceptually uniform color space for superior UI color operations
38
+ ---
39
+
40
+ <div class="explore-hint" style="text-align: center; margin: 32px 0 48px; position: relative;">
41
+ <div class="explore-dots" style="display: inline-flex; align-items: center; gap: 4px;">
42
+ <span class="dot" style="font-size: 11px; letter-spacing: 0.5px; color: var(--vp-c-text-3); opacity: 0.8; transition: all 0.3s ease;">•</span>
43
+ <span class="dot" style="font-size: 11px; letter-spacing: 0.5px; color: var(--vp-c-text-3); opacity: 0.8; transition: all 0.3s ease; transition-delay: 0.1s;">•</span>
44
+ <span class="dot" style="font-size: 11px; letter-spacing: 0.5px; color: var(--vp-c-text-3); opacity: 0.8; transition: all 0.3s ease; transition-delay: 0.2s;">•</span>
45
+ </div>
46
+ <p class="explore-text" style="font-size: 13px; color: var(--vp-c-text-3); margin-top: 8px; opacity: 0.7; transition: all 0.3s ease;">
47
+ Professional color tools for modern development
48
+ </p>
49
+ </div>
50
+
51
+ <div style="margin-top: 48px;">
52
+
53
+ ## What is Coolors MCP?
54
+
55
+ </div>
56
+
57
+ Coolors MCP is a Model Context Protocol (MCP) server that provides advanced color operations and utilities to AI assistants like Claude. It integrates Google's Material Color Utilities algorithms with sophisticated CSS theme matching capabilities, enabling AI-powered color workflows that were previously impossible.
58
+
59
+ ### Key Features
60
+
61
+ - **🎨 Complete Color Toolkit**: Convert between any color format, calculate perceptual distances, and generate harmonious palettes
62
+ - **🎭 Material Design Integration**: Generate full Material Design 3 themes with tonal palettes and semantic roles
63
+ - **🔄 CSS Theme Refactoring**: Automatically replace hardcoded colors with theme variables in your CSS
64
+ - **📊 HCT Color Space**: Use Google's perceptually uniform color space for accurate color operations
65
+ - **🖼️ Image Analysis**: Extract dominant colors and generate themes from images
66
+ - **♿ Accessibility First**: Built-in WCAG contrast checking and accessibility compliance
67
+ - **🎯 Smart Matching**: Multi-factor algorithm considers perceptual distance, semantic context, and accessibility
68
+
69
+ ### Why HCT Over LAB?
70
+
71
+ HCT (Hue, Chroma, Tone) is Google's color space specifically designed for UI applications:
72
+
73
+ - **Tone Component**: Directly correlates with contrast ratios (40 tone = 3:1, 50 tone = 4.5:1)
74
+ - **Perceptual Uniformity**: Better than LAB for UI color operations
75
+ - **Material Design Native**: Used in production by Android and Material Design
76
+ - **Semantic Understanding**: Better mapping between color relationships and UI roles
77
+
78
+ <div style="margin-top: 48px;">
79
+
80
+ ## Quick Start
81
+
82
+ </div>
83
+
84
+ ### For Claude Code Users
85
+
86
+ ```bash
87
+ # One-command installation
88
+ claude mcp add coolors -- npx -y @trishchuk/coolors-mcp
89
+
90
+ # Verify installation
91
+ /mcp
92
+ ```
93
+
94
+ ### For Claude Desktop Users
95
+
96
+ Add to your configuration file:
97
+
98
+ ```json
99
+ {
100
+ "mcpServers": {
101
+ "coolors": {
102
+ "command": "npx",
103
+ "args": ["-y", "@trishchuk/coolors-mcp"]
104
+ }
105
+ }
106
+ }
107
+ ```
108
+
109
+ ### Example Usage
110
+
111
+ Once installed, you can use natural language to work with colors:
112
+
113
+ ```
114
+ // Color conversion
115
+ "convert #6366F1 to HSL and LAB formats"
116
+
117
+ // Generate Material theme
118
+ "create a Material Design 3 theme from #6366F1"
119
+
120
+ // CSS refactoring
121
+ "match all hardcoded colors in my CSS to theme variables"
122
+
123
+ // Image analysis
124
+ "extract the dominant colors from this image and create a theme"
125
+
126
+ // Accessibility checking
127
+ "check the contrast between #6366F1 and white"
128
+ ```
129
+
130
+ <div style="margin-top: 48px;">
131
+
132
+ ## Core Capabilities
133
+
134
+ </div>
135
+
136
+ ### Color Operations
137
+ - Convert between hex, RGB, HSL, LAB, and HCT formats
138
+ - Calculate perceptual distance using Delta E 2000
139
+ - Generate color palettes (monochromatic, analogous, complementary, etc.)
140
+ - Create smooth gradients with multiple interpolation methods
141
+
142
+ ### Material Design
143
+ - Generate complete Material Design 3 themes
144
+ - Create tonal palettes with standard Material tones
145
+ - Harmonize multiple colors to work together
146
+ - Fix universally disliked colors (dark yellow-greens)
147
+
148
+ ### CSS Theme Matching
149
+ - Find closest theme variables for any color
150
+ - Automatically refactor CSS with theme variables
151
+ - Batch process multiple colors at once
152
+ - Confidence scoring for replacements
153
+
154
+ ### Image Processing
155
+ - Extract dominant colors using Celebi quantization
156
+ - Generate themes from image colors
157
+ - Score colors for UI suitability
158
+ - Detect and fix disliked colors
159
+
160
+ <div style="margin-top: 48px;">
161
+
162
+ ## Documentation
163
+
164
+ </div>
165
+
166
+ - [Getting Started](/getting-started) - Installation and setup guide
167
+ - [Tools Reference](/tools/README) - Complete tool documentation
168
+ - [Color Spaces](/concepts/color-spaces) - Understanding different color models
169
+ - [HCT System](/concepts/hct) - Google's perceptually uniform color space
170
+ - [Material Design](/concepts/material-design) - Material Design 3 integration
171
+
172
+ <div style="margin-top: 48px;">
173
+
174
+ ## Community & Support
175
+
176
+ </div>
177
+
178
+ - **GitHub**: [x51xxx/coolors-mcp](https://github.com/x51xxx/coolors-mcp)
179
+ - **Issues**: [Report bugs or request features](https://github.com/x51xxx/coolors-mcp/issues)
180
+ - **NPM**: [@trishchuk/coolors-mcp](https://www.npmjs.com/package/@trishchuk/coolors-mcp)
181
+
182
+ <div style="margin-top: 48px;">
183
+
184
+ ## License
185
+
186
+ </div>
187
+
188
+ This project is licensed under the MIT License. See the [LICENSE](https://github.com/x51xxx/coolors-mcp/blob/main/LICENSE) file for details.
189
+
190
+ **Built with** ❤️ **using Google's Material Color Utilities algorithms**
@@ -0,0 +1,157 @@
1
+ # Installation
2
+
3
+ Multiple ways to install the Coolors MCP server, depending on your needs.
4
+
5
+ ## Prerequisites
6
+
7
+ - Node.js v18.0.0 or higher
8
+ - Claude Desktop or Claude Code with MCP support
9
+
10
+ ## Method 1: NPX (Recommended)
11
+
12
+ No installation needed - runs directly:
13
+
14
+ ### Claude Desktop Configuration
15
+ ```json
16
+ {
17
+ "mcpServers": {
18
+ "coolors": {
19
+ "command": "npx",
20
+ "args": ["-y", "@trishchuk/coolors-mcp"]
21
+ }
22
+ }
23
+ }
24
+ ```
25
+
26
+ ### Claude Code Configuration
27
+ ```bash
28
+ claude mcp add coolors --npm-package @trishchuk/coolors-mcp
29
+ ```
30
+
31
+ ## Method 2: Global Installation
32
+
33
+ ### Install globally
34
+ ```bash
35
+ npm install -g @trishchuk/coolors-mcp
36
+ ```
37
+
38
+ ### Claude Desktop Configuration
39
+ ```json
40
+ {
41
+ "mcpServers": {
42
+ "coolors": {
43
+ "command": "coolors-mcp"
44
+ }
45
+ }
46
+ }
47
+ ```
48
+
49
+ ### Claude Code Configuration
50
+ ```bash
51
+ claude mcp add coolors --command coolors-mcp
52
+ ```
53
+
54
+ ## Method 3: Local Development
55
+
56
+ For development or local testing:
57
+
58
+ ```bash
59
+ # Clone the repository
60
+ git clone https://github.com/x51xxx/coolors-mcp.git
61
+ cd coolors-mcp
62
+
63
+ # Install dependencies
64
+ npm install
65
+
66
+ # Build the project
67
+ npm run build
68
+
69
+ # Test locally
70
+ node dist/bin/server.js
71
+ ```
72
+
73
+ ### Claude Desktop Configuration (Local)
74
+ ```json
75
+ {
76
+ "mcpServers": {
77
+ "coolors-dev": {
78
+ "command": "node",
79
+ "args": ["/path/to/coolors-mcp/dist/bin/server.js"]
80
+ }
81
+ }
82
+ }
83
+ ```
84
+
85
+ ## Verification
86
+
87
+ Test your installation with a simple color conversion:
88
+
89
+ ```json
90
+ {
91
+ "name": "convert_color",
92
+ "arguments": {
93
+ "color": "#6366F1",
94
+ "to": "hsl"
95
+ }
96
+ }
97
+ ```
98
+
99
+ Expected response: `"hsl(239, 84%, 67%)"`
100
+
101
+ ## Available Tools
102
+
103
+ Once installed, you'll have access to these tools:
104
+
105
+ ### Color Operations
106
+ - `convert_color` - Convert between color formats
107
+ - `color_distance` - Calculate perceptual distance
108
+ - `check_contrast` - WCAG contrast checking
109
+ - `generate_palette` - Create color palettes
110
+ - `generate_gradient` - Create smooth gradients
111
+
112
+ ### Material Design
113
+ - `generate_material_theme` - Full Material Design 3 theme
114
+ - `harmonize_colors` - Harmonize multiple colors
115
+ - `generate_tonal_palette` - Material tonal palette
116
+ - `analyze_color_likability` - Check for disliked colors
117
+
118
+ ### CSS Theme Matching
119
+ - `match_theme_color` - Find closest theme variable
120
+ - `refactor_css_with_theme` - Automated CSS refactoring
121
+ - `match_theme_colors_batch` - Batch color matching
122
+ - `generate_theme_css` - Generate CSS custom properties
123
+
124
+ ### Image Processing
125
+ - `extract_image_colors` - Extract dominant colors
126
+ - `generate_theme_from_image` - Create theme from image
127
+
128
+ ## Troubleshooting
129
+
130
+ Common issues:
131
+ - **Node.js version**: Ensure you have Node.js ≥18.0.0 (`node --version`)
132
+ - **Permission errors**: Try running with appropriate permissions
133
+ - **MCP connection issues**: Restart your Claude client after configuration changes
134
+ - **Module not found**: Ensure npm packages are properly installed
135
+
136
+ For more help, see the [FAQ](resources/faq) or [Troubleshooting Guide](resources/troubleshooting).
137
+
138
+ ## Support
139
+
140
+ Need help with installation or setup? Here's how to get assistance:
141
+
142
+ ### 🤝 Get Help
143
+ - **GitHub Issues**: [Report bugs or request features](https://github.com/x51xxx/coolors-mcp/issues)
144
+ - **GitHub Discussions**: [Ask questions and share ideas](https://github.com/x51xxx/coolors-mcp/discussions)
145
+ - **Email**: [taras@trishchuk.com](mailto:taras@trishchuk.com) for direct support
146
+
147
+ ### 📖 Documentation
148
+ - **[Getting Started Guide](getting-started)** - Complete setup and configuration
149
+ - **[Tools Reference](tools/README)** - Detailed tool documentation
150
+ - **[Examples](examples/basic-colors)** - Practical usage patterns
151
+
152
+ ### 🚀 Contributing
153
+ Interested in contributing? Check out our [Contributing Guide](https://github.com/x51xxx/coolors-mcp/blob/main/CONTRIBUTING.md) or reach out directly!
154
+
155
+ ---
156
+
157
+ **Developed by [Taras Trishchuk](https://github.com/x51xxx)** | Licensed under MIT