Color Studio
A native-feeling color toolbox for VS Code: explore color families, convert
between formats, generate perceptual scales and check contrast — without
leaving your editor.
Features
- Explore — 22 families × 11 shades from Tailwind v3, Tailwind v4 or the original Color Studio OKLCH palette. One-click copy, per-color format detail, favorites, recent colors and search by name / HEX / any supported format.
- Convert — universal converter for 18 formats (HEX, RGB, HSL, HSV, HWB, Lab, LCh, OKLab, OKLCH, XYZ, CMYK and
color(srgb · srgb-linear · display-p3 · rec2020 …)), with validation, gamut warnings and copy-all.
- Palette Generator — perceptual 50→950 scales in OKLCH (balanced, linear and HSL comparison), hue/chroma/lightness controls, manual overrides with locks and exports to CSS, SCSS, JSON, Tailwind v3/v4.
- Contrast — WCAG ratio with AA/AAA verdicts for normal and large text, live preview and suggestions that adjust OKLCH lightness to reach the target.
- Collections — named collections, favorites and recent colors persisted in VS Code global state.
- Settings — copy format, precision, gamut mapping strategy, CSS syntax and default catalog, mirrored to
colorStudio.* settings.
Each section is an independent, collapsible WebviewView in the Activity Bar — like VS Code's Source Control view.
Commands
| Command |
Keybinding |
Description |
Color Studio: Show |
— |
Reveal the Color Studio sidebar |
Color Studio: Convert color at cursor |
Ctrl+Alt+C / Cmd+Alt+C |
Parse the selection (or word under cursor) and open it in Convert |
Color Studio: Convert color from clipboard |
Ctrl+Alt+Shift+C / Cmd+Alt+Shift+C |
Same, reading the clipboard |
Also available from the editor context menu.
Development
pnpm install # extension host deps
pnpm --dir web install # webview deps (independent package)
pnpm run watch # exactly two watchers: esbuild (host) + Vite (webview)
Press F5 (Run Extension) and open the Color Studio icon in the Activity Bar.
pnpm run check-types # tsc (host) + svelte-check (all webview pages)
pnpm run lint # eslint
pnpm test # vitest unit tests
pnpm run package # production bundles → dist/ + media/
pnpm test:integration # downloads VS Code and runs the @vscode/test-electron suite
Theming
All webview colors come from VS Code theme variables (--vscode-*) as listed in the
Theme Color reference.
They are mapped once into semantic tokens in web/src/styles/app.css
(--cs-bg, --cs-fg, --cs-input-*, --cs-hover-*, --cs-warning, …), so the
views follow the active theme automatically — including high-contrast themes via
contrastBorder / contrastActiveBorder. Scrollbars are rendered by
overlayscrollbars (8 px, rounded, auto-hide on pointer leave) with the
os-theme-vscode theme driven by scrollbarSlider.*. Hardcoded colors are
fallbacks used only when running the Svelte pages standalone in a browser.
Architecture
src/core — pure color engine (parsing, conversion, gamut, palettes, contrast, export). No VS Code or DOM imports; unit-tested.
src/core/catalog + src/data/catalogs — catalog types, perceptual search and three generated catalogs (22 families × 11 steps each).
src/shared — typed message protocol, section constants and persisted-state types.
src/extension — extension host: one provider per section, commands, config bridge, registry and globalState store.
web/ — independent Svelte 5 package (src/pages/<section>, src/lib, svelte-check). Vite builds six separate HTML entries into web/dist; aliases @core, @shared, @data import host-side modules without duplication.
scripts/build.sh — builds web/ and copies artifacts into media/ (bundled in the VSIX). A Vite hook keeps media/ in sync during watch.
resources/icons/ — Activity Bar (SVG) and marketplace (PNG) icons.
License
MIT — see LICENSE.
| |