Electric Color
VS Code extension that colors matching words, numbers, punctuation, and symbols throughout every text document.
Run locally
- Open this folder in VS Code.
- Press
F5 and choose Run Electric Color.
- In the Extension Development Host, open a plaintext or source-code file.
Run Electric Color: Toggle Coloring from the Command Palette to disable or enable decorations.
Teams clipboard GUI
Open web/index.html in a browser, enter text, and select Copy for Teams.
The page puts both rich HTML and plain text on the clipboard, so Microsoft
Teams retains the Electric Color foregrounds and dark background while other
applications can fall back to unformatted text. Use Command+Enter to copy
without leaving the text box.
Configuration
electricColor.languages lists language IDs colored throughout the document. Its default, *, colors every text document.
electricColor.scopedLanguages lists language IDs colored only inside comments and strings when electricColor.languages does not include * or that language ID.
{
"electricColor.languages": ["*"]
}
A language listed in electricColor.languages uses full-document mode even if also listed in electricColor.scopedLanguages.
Source
src/colors.js: matching rules and colors.
src/scopes.js: comment and string scanner.
src/extension.js: VS Code activation, editor events, command, and decorations.
web/index.html: standalone rich-text clipboard GUI.
web/colorizer.js: browser colorizer and clipboard HTML renderer.
color.js and hooks.js: original browser-DOM prototypes; not loaded by the extension.
canvas.js: standalone Canvas 2D color rules and fillText/strokeText hooks.