hassanzohdy/copper/colors

Claude Code and agent skill by hassanzohdy/copper

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

ANSI colorizer with a 20+ named palette (basic 4-bit + 256-color hues like `lime`, `teal`, `brown`, `gold`, `chocolate`, `pink`, `purple`, `lavender`, `indigo`, `orange`, `slate`), foreground / background / *Bright* / *bgBright* variants, plus modifiers (`bold`, `italic`, `dim`, `underline`, `inverse`, `hidden`, `strikethrough`, `reset`). Supports BOTH chalk-style chaining (`colors.red.bold("x")`) and picocolors-style composition (`colors.red(colors.bold("x"))`). `NO_COLOR` and `FORCE_COLOR` aware.

Install

npx vskill@latest install hassanzohdy/copper/colors

SKILL.md

Colors

Chain colors and modifiers chalk-style. Each chain step builds a fresh callable formatter — lazy, stateless, reusable.

ts
import { colors, createColors, type ColorName, type ChainFormatter } from "@mongez/copper";
colors.red("error");
colors.red.bold("error");
colors.bgWhite.black.bold(" WARN ");
colors.gray.italic("hint");
colors.red.bold.underline("critical");
const danger = colors.red.bold.underline;
danger("File not found");
danger("Connection refused");
Composition (colors.red(colors.bold(x))) produces identical ANSI output and is the natural shape for indexed access (colors[name](x) where name is a runtime ColorName). Every chain example below has a composition equivalent — pick whichever reads better at the call site.

Modifiers

FunctionEffect
bold(s)Bold
dim(s)Faint
italic(s)Italic
underline(s)Underline
strikethrough(s)Strikethrough
inverse(s)Swap fg/bg
hidden(s)Invisible (still copies on select)
reset(s)Wraps with CSI 0 on both sides

Palette (foreground)

Each row also has *Bright, bg*, and bgBright* variants unless noted.

FamilyNames
Neutralblack, gray, white, blackBright, whiteBright
Slateslate, slateBright
Redred, redBright
Orangeorange, orangeBright
Yellowyellow, yellowBright
Goldgold, goldBright
Chocolatechocolate, chocolateBright
Brownbrown, brownBright
Greengreen, greenBright
Limelime, limeBright
Tealteal, tealBright
Cyancyan, cyanBright
Blueblue, blueBright
Magentamagenta, magentaBright
Purplepurple, purpleBright
Pinkpink, pinkBright
Lavenderlavender, lavenderBright
Indigoindigo, indigoBright
The standard 4-bit colors (red/green/…/white) use the 30-37 / 90-97 sequences. The extended hues (lime, teal, brown, gold, …) use 256-color sequences (\x1b[38;5;Nm) so terminals must support 256 colors — which all common modern terminals do.

createColors(enabled?) — force on or off

ts
const off = createColors(false);
off.red("hi"); // "hi" (no ANSI added)
off.isColorSupported; // false
const on = createColors(true);
on.red("hi"); // "\x1b[31mhi\x1b[39m"

Use this to:

  • Strip ANSI from a colored builder before snapshotting a test (createColors(false).red(x)).
  • Force ANSI in a sub-process whose stdout isn't a TTY but is being captured.
  • Build a separate "diff" or "patch" themed instance with its own palette.

Typed color names (the composition case)

When the color name is decided at runtime, indexed access + composition is the right shape — chains are a compile-time-only thing:

ts
import { colors, type ColorName } from "@mongez/copper";
function paint(level: "ok" | "fail", text: string) {
const c: ColorName = level === "ok" ? "green" : "red";
return colors[c](text);
}
// Add a modifier via composition:
colors[c](colors.bold(text));

ColorName is derived from the COLOR_NAMES tuple — it excludes the meta keys isColorSupported and createColors so colors[name] is always a callable formatter.

Replacing chalk

Near-1:1 import swap thanks to chaining:

ts
- import chalk from "chalk";
+ import { colors } from "@mongez/copper";
- chalk.red(text);
+ colors.red(text);
- chalk.red.bold(text);
+ colors.red.bold(text);
- chalk.bgWhite.black.bold(text);
+ colors.bgWhite.black.bold(text);

For chalk's tagged-template syntax (chalk\{red ${value}}\`), use colorize-template` against the copper instance:

ts
import { createColorize } from "colorize-template";
import { colors } from "@mongez/copper";
const colorize = createColorize(colors);
colorize`{red.bold Build} took {yellow ${ms}ms}`;

Composition safety

When you nest colors.x(colors.y(text)) (or chain colors.x.y(text)) and text already contains the inner closer code, copper rewrites internal closers to re-open the outer color — so chains do not leak:

ts
colors.bold(colors.red("inner"));
// "\x1b[1m\x1b[31minner\x1b[39m\x1b[22m" ← red closer (39m) does not eat bold

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/hassanzohdy/copper/colors/badge)](https://verified-skill.com/skills/hassanzohdy/copper/colors)

Something wrong with this skill or its page? Tell us.