Community影像github.com

調色板

建立、檢查與匯出色板——從照片或情緒板中提取,產生 OKLCH 色調與深淺變化 (50–950),檢查 WCAG 對比度,並匯出為 CSS 變數、Tailwind、設計代碼、Adobe ASE、GIMP/Krita GPL 或色票圖。

調色板 是什麼?

這個技能提供一個全面的命令列工具,用於處理色板。它能從圖片中提取主色(使用 k-means 分群)、從單一品牌色生成感知上均勻的色階 (50–950)、計算互補等色彩和諧方案,並嚴格檢查 WCAG AA/AAA 對比度。它的數學運算基於 OKLab 與 OKLCH 色彩空間,確保感知準確。該工具可匯出到多種格式:網頁專案的 CSS 變數或 Tailwind 設定、設計代碼 (Tokens Studio)、Adobe 產品的 ASE、GIMP/Krita 的 GPL,以及用於視覺檢查的色票圖像 (PNG/SVG)。它最關鍵的設計判斷是:使用者需要為每個顏色指定一個角色(背景、文字、強調),並在展示前驗證對比度。它鼓勵設計師手動修正機器提取的結果(因為機器常將大面積區域誤判為「背景」),並且引導使用者偏好帶有設計感的米白與米黑,而非純白與純黑。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Remicht0/graphic-design-skills/tree/HEAD/skills/palette

Installed? Explore more 影像 skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

調色板 是做什麼的?

scripts/palette.py 負責色彩數學運算(OKLab/OKLCH、WCAG 對比度、k-means 提取)並為設計工具寫入檔案。你的工作是頂層的設計判斷:哪些顏色該擔任特定角色、調色板是否真的適合文字,以及用白話解釋這些選擇。

命令

# 1. 從圖片:主色及其在圖片中的佔比 + 色票圖
python3 scripts/palette.py extract photo.jpg -n 6 -o palette.json --sheet palette.png

# 2. 無障礙:哪些配對可以承載文字
python3 scripts/palette.py contrast palette.json
python3 scripts/palette.py contrast "#111111,#F2EFE9,#FF4F12"

# 3. 從一個品牌色產生完整色階 (50 … 950),感知上均勻
python3 scripts/palette.py scale "#2D4CB4" --name cobalt --keep -o cobalt.json

# 4. 和諧:互補 | 類似色 | 三色 | 分裂互補 | 四色
python3 scripts/palette.py harmony "#FF4F12" --type split

# 5. 匯出:css | scss | tailwind | tokens | json | ase | gpl | svg | png
python3 scripts/palette.py export palette.json --to ase -o palette.ase
python3 scripts/palette.py export palette.json --to tailwind

調色板是由指令碼寫入的 JSON 檔案,或者只是一個逗號分隔的十六進位制顏色列表。你可以手動編輯 JSON(重新命名顏色、刪除某個顏色)並將其重新餵給 contrast 或 export。

工作方式

  1. 從使用者已有的來源出發:一張照片、一個情緒板、一個標誌、一個現有品牌色,或只是用文字描述的氛圍。如果是文字描述,先自己提出 4–6 個十六進位制值,然後對它們執行 contrast:絕不要在未檢查的情況下展示一個調色板。
  2. 給每個顏色一個職責。 一個可用的調色板不是六個等值的顏色。命名角色:背景(紙)、墨水(文字)、強調色(每頁使用一到兩次),再加上輔助中性色。大約 60% 背景、30% 墨水與中性色、10% 強調色。extract 會自動猜測背景/墨水/強調色;當它猜錯時要修正(它經常把大面積的區域當作「背景」)。
  3. 在交付前檢查對比度。 正文需要 4.5:1(WCAG AA);大字型(≥ 24 px,或 ≥ 18.5 px 粗體)需要 3:1;標誌與純裝飾性元素不受限制。如果墨水在背景上失敗,不要放棄這個配對,而是加深墨水或提亮背景。清楚地說明哪些配對適合文字。
  4. 色階 (scale) 適用於需要深淺變化的 UI 與品牌系統。--keep 將確切的品牌色保留在最近的階層上,並報告該階層(「你的藍色是 cobalt-700」)。色度往淺色端與深色端逐漸降低,使淺色調不會看起來像霓虹色,深色調也不會顯得汙濁。
  5. 以使用者工具能讀取的格式匯出:
    工具格式
    Illustrator、InDesign、Photoshop、Affinity、Procreate(匯入)ase
    Figmatokens(透過 Tokens Studio 外掛)或貼上 hex
    網頁css、scss、tailwind (v4 @theme)
    GIMP、Krita、Inkscapegpl
    可分享的視覺png(色票圖)或 svg

關於判斷的筆記

  • 照片很少能直接提供好的調色板:k-means 結果反映的是區域面積,而不是重要性。一個小小的紅色物體可能比一大片灰色牆壁更重要。親自檢視圖片,並換上能承載圖片識別度的顏色。
  • 米白與米黑 (#F2EFE9, #151515) 比純白與純黑 (#FFF, #000) 更有設計感,且幾乎能保持相同的對比度。
  • 兩個亮度相同的飽和色接觸時會產生震動。檢查 OKLCH 亮度(表格輸出中的 L):如果兩個強調色的 L 值幾乎相同,就分開它們或改變其中一個。
  • 對於印刷,這裡給的是 RGB 值。告知使用者應在排版軟體中根據自己的印表機設定檔轉換為 CMYK 或 Pantone;螢幕到印刷的色差是正常的,尤其對於亮綠色、藍色和橙色。

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

art-direction-analyzer

Break down the art direction of a live website — typography, color palette, grid and spacing, motion and interactions, imagery — by inspecting the rendered page (computed styles, screenshots, hover states), and save a structured reference file with screenshots for a design inspiration library. Use whenever the user wants to study, deconstruct, scrape or reverse-engineer a site's design, visual identity, UI or motion, save a site as a reference or moodboard entry, or asks "how did they do this" about a website — even without the word "analysis".

dither

Turn photos and images into dithered, halftoned or bitmap graphics (Floyd–Steinberg, Atkinson, Bayer, halftone dots, duotone, risograph-style color) as PNG or SVG, sized for screen or print. Use when the user wants a dithered, 1-bit, pixel, halftone, newspaper, risograph, screen-print or "old Mac" look, a bitmap/trame effect, or an image prepared for laser engraving or a plotter.

editorial-layout

Design editorial, magazine-style PDF layouts in HTML/CSS — briefs, reports, portfolios, zines, presentations, posters, Instagram carousels — on a 12-column print grid with extreme type scale, one accent color, bleeding images and varied compositions, then render to a print-ready PDF (with bleed) plus PNG previews and automatic layout checks. Use whenever the user wants a document, PDF, deck, booklet or boards that look designed rather than templated, or asks for a magazine, editorial or Swiss-style layout.

print-preflight

Check a PDF before it goes to the printer — bleed, trim size, image resolution at placed size, embedded fonts, RGB vs CMYK vs spot colors, total ink coverage, hairlines, transparency, layers and annotations — and explain each problem with the fix for InDesign, Illustrator, Affinity, Canva or Figma. Use whenever the user is about to print something (flyer, poster, business card, book, zine, packaging) or asks "is my file OK for print", "why did the printer reject my file", or wants a PDF checked.

相關技能