vscode-peacock

johnpapaMIT活跃维护

给 VS Code 工作区换个低调的主题色,多开窗口或使用 Live Share、Remote 时一眼就能认出当前编辑器。

Subtly change the color of your Visual Studio Code workspace. Ideal when you have multiple VS Code instances, use VS Live Share, or use VS Code's Remote features, and you want to quickly identify your editor.

v4.5.1发布于 2026-09-29 17:37 UTC1,194star +2 / 7 天159fork同步于 2026-11-10 17:52 UTC

怎么上手

由 README 提炼,执行前请确认
在 VS Code 扩展面板搜索 Peacock 并点击 Install,必要时点击 Reload
硬件要求按 README 说明

README 未说明,仅需安装 VS Code 即可使用

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

VS Code 扩展,给不同工作区换标题栏颜色,多开窗口时一眼认出是哪个项目

给 VS Code 工作区换个低调的主题色,多开窗口或使用 Live Share、Remote 时一眼就能认出当前编辑器。

核心能力

  • 用命令面板执行 Peacock 命令切换工作区颜色
  • 提供预定义收藏色板供快速选择
  • 同时适配 VS Code 经典 UI 与 Modern UI
  • 适合多实例、Live Share 和 Remote 场景区分编辑器

容易踩的坑

Peacock 只在 Workspace 中生效,单文件打开时命令可能不出现;需先创建或打开一个 VS Code Workspace

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v4.5.1
  1. v4.5.14.5.1最新正式版2026-09-29 · 2026-09-29 17:37 UTC

    A patch release focused on Custom Color Picker performance, plus a 92% smaller published package.

    Fixes

    • Fixed the Custom Color Picker slowing VS Code down while dragging the color well (#776). Dragging the well fires an input event on essentially every pixel of movement, and each one used to call applyColor() -- a read-modify-write of workbench.colorCustomizations in settings.json plus a full workbench theme re-render. Previewing now debounces that write, so an entire drag gesture collapses into a single write once the cursor settles (150ms) instead of one write per event. The picker's own title-bar contrast swatch still updates instantly on every event (a cheap in-memory computation), your real title bar/status bar still update live a fraction of a second after you stop moving, and Apply still commits the final color immediately without waiting out the debounce.

    Infrastructure

    • Shrunk the published VSIX from 841 KB to 67 KB (a 92% reduction) by excluding files that were never needed at runtime. resources/hero.png, resources/modern-ui-classic.png, resources/modern-ui-modern.png, and resources/peacock-icon-small.png accounted for ~838 KB of that, but every one of them is referenced from README.md by an absolute raw.githubusercontent.com URL -- so the Marketplace and the VS Code extension pane have always rendered them straight from GitHub, never from the package. Only resources/peacock-icon.png is genuinely required (it backs package.json's icon field) and it still ships. AGENTS.md and .mcp.json were also leaking in as dev-only tooling config. scripts/check-vsix-contents.js now treats AGENTS.md and .mcp.json as disallowed filenames, and its size ceiling drops from 2048 KB to 256 KB, so a future regression of this kind fails CI instead of silently shipping (#780)
    • Routed all three of the Custom Color Picker's applyColor() calls -- the debounced preview, Apply, and Cancel/panel-close -- through a single shared serializer. Debouncing moved the preview's write off the picker's existing message queue and onto a timer, so a debounced write that had already fired could still be in flight when the user committed or canceled; the two overlapping workbench.colorCustomizations read-modify-writes could then land out of order, clobbering the committed color or leaving a canceled one applied. Serializing restores the guarantee that the last write requested is the last one written (#777)
    • Fixed Cancel (and closing the panel) not reverting an already-applied preview when the picker was opened with no color previously set (startingColor === '') -- the revert now always calls applyColor(startingColor) and relies on its existing empty-string handling to unapply, instead of skipping the call whenever startingColor was falsy (#777)

    Tests

    • Added a debounce() utility (src/debounce.ts) with unit tests covering burst-collapsing, cancellation, and back-to-back separate bursts, plus host-lane coverage proving a simulated 40-event color-well drag collapses into a single applyColor() write with the final previewed color -- not one write per event -- guarding against the exact performance regression reported in #776
    • Added a regression test proving Cancel unapplies (rather than leaves applied) a debounce-settled preview when the picker started with no color set, covering the empty-startingColor case the rest of the cancel/close coverage didn't exercise (#777)
    • Added a regression test that stubs applyColor() with a deliberately slow fake and asserts a debounced preview wri
  2. v4.5.0Peacock 4.5.02026-09-28 · 2026-09-28 01:09 UTC
    查看更新说明

    Fixes

    • Fixed unfocused windows losing Peacock's status bar color: when peacock.affectStatusBar is enabled, Peacock now writes statusBar.inactiveBackground alongside the active status bar token so VS Code keeps the Peacock color even after the window loses focus (#773)
    • Re-pinned @types/vscode to 1.49.0 (matching engines.vscode) so vsce packaging no longer fails with @types/vscode ... greater than engines.vscode ... when CI runs npm run package:check. Also told Dependabot to ignore @types/vscode until Peacock intentionally raises its minimum supported VS Code version, preventing the same incompatible bump from reopening CI failures.

    Infrastructure

    • Bumped morgan (transitive dev dependency) from 1.10.1 to 1.12.0, picking up fixes for log-injection CVEs in the :remote-user token and token value escaping (#760)
    • Added a required main branch ruleset (the CI / build status check, plus automatic Copilot code review on every PR/push) now that CI passing is enforced before merge, not just advisory. Because ci.yml's build job previously used paths-ignore to skip docs/markdown-only changes, a docs-only PR could never satisfy this new required check and would be permanently blocked; ci.yml now always triggers and instead detects a docs-only diff internally (via dorny/paths-filter) to skip the actual lint/build/test steps while still reporting the same single build check. An initial fix using a second, docs-only-triggered workflow was reverted after code review flagged that a mixed docs+code PR would trigger both workflows and produce two ambiguous, identically-named CI / build checks.

    Features

    • Added a visual color picker to the Peacock: Change to a Favorite Color flow. The favorites Quick Pick now ends with a $(paintcan) Custom color… item that opens a webview with a native color well kept in sync with a hex/name/formula text field. Every edit previews live (the same way hovering a favorite already does, without unapplying your current color just from arrowing over the item), Apply keeps the color, and Cancel (or closing the panel) reverts to the color that was active before the picker opened. The Quick Pick now always opens, even with zero favorites saved, so the picker is reachable regardless (#708)
    • Merged Peacock: Enter a Color with the visual picker into a single Peacock: Choose a Custom Color command: running it with no arguments now opens the Custom Color Picker directly, and its color field accepts every format the old input box did (hex, named colors, and rgb/rgba/hsl/hsla/hsv/hsva values), not just hex. The peacock.enterColor command ID is unchanged, so existing keybindings and scripts that invoke it programmatically with a color argument keep working exactly as before (#708 follow-up)
    • Designed the color picker panel with a modern layout: a labeled color-well/field group, an eyedropper button (shown when the browser EyeDropper API is available) to sample any color from anywhere on screen, and a live title bar contrast preview — a sample swatch plus a WCAG contrast ratio badge — that reuses Peacock's own title-bar contrast logic, so a light custom color (e.g. orange or pink) is confirmed to get the same automatic dark-font contrast treatment as any other color, before you even apply it. The preview reflects your actual peacock.affectTitleBar/peacock.keepForegroundColor settings (with a note when the pairing doesn't apply), an invalid typed color (e.g. a color-name typo) marks the field invalid and disables Apply instead of doing nothing, Enter/Escape apply/cancel no matter which control has focus, and the panel's state (including the preview)
  3. v4.4.1Peacock 4.4.12026-09-07 · 2026-09-07 17:03 UTC
    查看更新说明

    Fixes

    • Fixed the currently-selected activity bar icon rendering VS Code's default gray instead of Peacock's colorized foreground under Modern UI's "activity bar on top" layout (and, more subtly, in the classic side layout too). Peacock now sets activityBar.activeBorder and activityBarTop.activeBorder explicitly to match the computed foreground (#652)

    Docs

    • Documented why a colored vertical line can appear between the side bar and editor with modernUI enabled — this is expected behavior when Peacock's affectEditorGroupBorder setting is on, not a bug (#652)

    Full Changelog: https://github.com/johnpapa/vscode-peacock/compare/v4.4.0...v4.4.1

  4. v4.4.02026-09-07 · 2026-09-07 16:23 UTC
    查看更新说明

    Features

    • Added automatic migration that backs up existing workbench.colorCustomizations on first extension activation, preventing data loss when installing Peacock in workspaces with pre-existing color customizations. Users receive a notification with the option to view backed-up settings (#687)

    Fixes

    • Fixed a release-blocking vsce package failure: dependabot PR #733 bumped @types/vscode to ^1.134.0 without a corresponding engines.vscode bump, and vsce refuses to package when the declared type definitions are newer than the minimum VS Code version the extension claims to support (@types/vscode ^1.134.0 greater than engines.vscode ^1.49.0). Reverted @types/vscode to 1.49.0 to match the existing engines.vscode floor rather than raising the minimum supported VS Code version as a side effect of an unrelated dependency bump — Peacock's code doesn't use any VS Code API newer than 1.49.0
    • Fixed title bar text readability on dark color schemes in Cursor IDE. Peacock now gates the mid-gray title bar foreground workaround (#647) behind a background.isLight() check, using adaptive light foreground (#e7e7e7) for dark schemes to maintain WCAG AA contrast ratios while preserving the toolbar icon visibility fix on light backgrounds (#700)
    • Fixed a tinycolor2 CJS/ESM interop bug: color-library.ts's import * as tinycolor from 'tinycolor2' compiles to a raw require() under the project's classic (non-esModuleInterop) TypeScript/webpack build, but under Vite/esbuild's stricter ESM semantics a namespace import can never be callable, so any color-manipulation call built with Vite (including the new Vitest unit lane) failed with TypeError: ... is not a function. Switched to import tinycolor = require('tinycolor2'), which compiles identically (a plain require()) under both toolchains (#670)
    • Reconciled the title bar foreground fix (#700) with the extracted getTitleBarForegroundForApp helper (#670) — the helper now takes the background color and applies the same light/dark gating as the host fix, instead of unconditionally overriding the Cursor foreground
    • Removed the one-time workbench.experimental.modernUI compatibility notice. The root cause was upstream in VS Code: modern UI mode forced the title bar, activity bar, and status bar to transparent backgrounds/borders with !important, overriding Peacock's (and any theme's) color customizations — reported as microsoft/vscode#326126 "Some color theme settings and color customizations are ignored in modern UI mode", fixed by microsoft/vscode#329701 "Restore theme colors in Modern UI shell" (merged August 2026). This is confirmed by multiple independent user reports on #652, so the warning was no longer accurate and was confusing users (#711). Added a regression test asserting applyColor() writes an identical workbench.colorCustomizations payload whether modernUI is enabled or disabled, so Peacock's own write path stays provably UI-mode-agnostic. The first version of that test actually caught a bug in itself, not in Peacock: it compared VS Code's live WorkspaceConfiguration object directly, which carries get/has/inspect/update methods as own properties, so assert.deepStrictEqual failed on function-reference identity even though every real color value matched. Fixed by comparing plain data via getColorCustomizationConfigFromWorkspace() instead.

    Docs

    • Added a README comparison showing Peacock working identically in VS Code's classic UI and the new Modern UI, as a visual companion to the Modern UI compatibility fix above.
    • Clarified `pea
  5. v4.3.4Peacock 4.3.42026-07-19 · 2026-07-19 18:49 UTC
    查看更新说明

    Includes a one-time in-product notice when workbench.experimental.modernUI is enabled, docs FAQ update, changelog entry, regression tests, and packaging fix to exclude e2e screenshots so VSIX is small (~243KB). PRs: #682 (notice/docs/tests), #683/#684/#685 (.vscodeignore and packaging). Tracking issue: #652.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Peacock for Visual Studio Code

    AI Ready

    Visual Studio Marketplace Version

    Peacock Icon

    Subtly change the color of your Visual Studio Code workspace. Ideal when you have multiple VS Code instances, use VS Live Share, or use VS Code's Remote features, and you want to quickly identify your editor.

    Read the extensive documentation here which includes a guide on how to use Peacock and a changelog

    Install

    1. Open Extensions sideBar panel in Visual Studio Code and choose the menu options for View → Extensions
    2. Search for Peacock
    3. Click Install
    4. Click Reload, if required

    Documentation

    Read the extensive documentation here which includes a guide on how to use Peacock and a changelog

    Quick Usage

    Let's see Peacock in action!

    1. Create/Open a VSCode Workspace (Peacock only works in a Workspace)
    2. Press F1 to open the command palette
    3. Type Peacock
    4. Choose Peacock: Change to a favorite color
    5. Choose one of the pre-defined colors and see how it changes your editor

    Now enjoy exploring the rest of the features explained in the docs!

    Peacock Windows

    Works with Modern UI

    Peacock works whether you're on VS Code's classic UI or the new Modern UI — same colors, same experience.

    Classic UIModern UI
    Peacock in classic UIPeacock in modern UI

    Resources

    Credits

    Inspiration comes in many forms. These folks and teams have contributed either through ideas, issues, pull requests, or guidance. Thank you!

    Code of Conduct

    Code of Conduct.

    Contributing

    The fastest way to contribute is with Copilot CLI — it knows this repo's conventions automatically:

    copilot "Add a new command called 'Change to a Seasonal Color' that picks a color based on the current season"
    

    Or contribute manually — see CONTRIBUTING.md for the full guide:

    1. Fork this repo and create a branch
    2. npm install → make your changes → npm test
    3. Open a PR

    See AGENTS.md for the full project guide including architecture, patterns, and how to add commands/settings.

    Problems or Suggestions

    Open an issue here

    workbench.experimental.modernUI compatibility was fixed upstream in VS Code and Peacock colors now apply normally with it enabled. See #652 for history.

    Contributors

    Contribution guidelines are located here

    Thanks goes to these wonderful people (emoji key):

    This project follows the all-contributors specification. Contributions of any kind welcome!