Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Simple Color Swatch

Renan SantosRenan Santos19 downloads

Shows a color swatch next to CSS color codes, like VS Code.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates2

Simple Color Swatch shows a small colored square next to CSS color codes in Obsidian, inspired by the color decorator in VS Code.

Supported colors

The plugin recognizes:

  • Hexadecimal colors: #RGB, #RGBA, #RRGGBB, and #RRGGBBAA.
  • CSS color functions: rgb(), rgba(), hsl(), hsla(), hwb(), lab(), lch(), oklab(), oklch(), and color().

Named colors such as red are not recognized.

Where swatches appear

Context Hex colors CSS functions
Inline code, for example `#fff` or `color: #ff0000` Yes Yes
Fenced or indented code blocks Yes Yes
Escaped hex in plain text, for example \#ff0000 Yes —
Plain-text functions, for example rgb(255, 0, 0) — Yes

Unescaped hex values in plain text are not decorated in Live Preview because they can be Obsidian tags. Reading mode skips rendered tag elements as well. Hex values and CSS functions are recognized inside code regardless of surrounding code text. Invalid CSS values are rejected by the browser's native CSS parser.

Settings

The settings tab provides independent toggles for:

  • Editing mode (Live Preview).
  • Reading mode.
  • Hexadecimal colors.
  • CSS color functions.

Changes apply to open notes immediately and are persisted in the plugin data.

Installation

Download the release assets from the plugin's GitHub release page and copy main.js, manifest.json, and styles.css into:

<vault>/.obsidian/plugins/simple-color-swatch/

Then enable Simple Color Swatch in Obsidian's Community Plugins settings.

Development

pnpm install
pnpm dev       # watch and rebuild
pnpm build
pnpm lint
pnpm test
node ./install.mjs

install.mjs copies the compiled plugin to the vault in the OBSIDIAN environment variable. You can set it in a root .env file (OBSIDIAN=/path/to/vault); a shell environment variable takes precedence. If neither is set, the script uses its configured local test vault. Copy .env.example as a starting point.

Notes and privacy

The plugin never modifies note files. Swatches are editor decorations in Live Preview and DOM-only additions in reading mode. The only persisted data is the plugin's own settings.

The design source of truth is .agents/PLAN.md, and execution progress is tracked in .agents/tasks/.

HealthExcellent
ReviewSatisfactory
About
Display a colored swatch next to CSS color codes in notes, supporting hex formats (#RGB, #RGBA, #RRGGBB, #RRGGBBAA) and CSS functions like rgb(), rgba(), hsl(), hsla(), hwb(), lab(), lch(), oklab(), oklch(), and color(). Render swatches in Live Preview, reading mode, fenced/inline code and escaped hex in plain text; skip unescaped plain-text hex to avoid tag conflicts. Ignore named colors such as red.
AppearanceCSS
Details
Current version
1.0.2
Last updated
4 days ago
Created
Last week
Updates
2 releases
Downloads
19
Compatible with
Obsidian 1.13.0+
Platforms
Desktop, Mobile
License
0BSD
Report bugRequest featureReport plugin
Author
Renan SantosRenan Santosrenansantos7
renansantos7.github.io/
GitHubrenansantos7
  1. Community
  2. Plugins
  3. Appearance
  4. Simple Color Swatch

Related plugins

Style Settings

Adjust theme, plugin, and snippet CSS variables.

Custom Font Loader

Customize your vault with any font you want (+ Support for Android and iOS).

Lapel

Show the heading levels in the gutter of the editor.

Show Whitespace

CSS styles and CM6 extensions to highlight whitespace in Source and Live Preview modes.

Snippetor

Create and tweak common snippets.

Better Bullets

Improves readability of bulleted notes.

Animated Cursor

Simple yet smooth animated cursor.

Focus Mode

Add a toggle to hide interface elements so you can focus on your note.

Fontsource

Load custom fonts from Fontsource into your notes.

Agentage Galaxy

Visualize your vault as a 3D, rotating force-graph: notes are nodes, links are edges. Search, filter, and orbit your knowledge graph from the toolbar. Part of Agentage.