Colour swatches and a colour picker for hex colours in TypeScript — the same
thing VS Code already does for CSS, now for .ts and .tsx.
What it does
Puts a colour swatch beside every hex colour in a string, template literal or
comment: #RGB, #RGBA, #RRGGBB, #RRGGBBAA.
Click the swatch to open VS Code's built-in colour picker. Pick a colour and
the literal is rewritten in place.
Rewrites keep the shape you wrote: #f80 stays short while it still can,
#FF8800 stays long and upper case, and alpha appears only when it drops
below 1.
Leaves alone what merely looks like a colour — private class fields
(this.#abc), regex bodies (/#[0-9a-f]{6}/), numbers (0xff0000).
No configuration, no runtime dependencies, nothing to turn on.
Install
VS Code — search for Hex TS in the Extensions view, or install from the
Marketplace.