Custom Tag Color

approved

by Anand Baghel

Define custom text colors (and derived backgrounds) for tags based on regex patterns. - This plugin has not been manually reviewed by Obsidian staff.

208 downloadsUpdated 1mo agoMIT

Custom Tag Color

An Obsidian plugin that lets you assign custom colors to tags using regular expression (regex) patterns. Create flexible rules that automatically color tags based on their names, prefixes, numbering schemes, dates, times, emojis, and more.

Features

  • 🎨 Assign custom color to tags.
  • 🔍 Match tags using powerful regular expressions.
  • 📋 First matching rule takes priority.
  • 🌈 Automatically derives complementary background colors.
  • ➕ Add, edit, and remove rules from an intuitive settings panel.
  • ♻️ Reset all rules to the default example configuration.
  • 📱 Works on both desktop and mobile versions of Obsidian.

Examples

GoalRegex Pattern
Match exactly #important^important$
Match dates like #21/06/2026^\d{2}/\d{2}/\d{4}$
Match times like #09:30^\d{2}:\d{2}$
Match times like #09-30^\d{2}-\d{2}$
Match #war1, #war25, #article10^(war|article)\d+$
Match numeric tags^\d+$
Match tags starting with status-^status-.*$

Regex Quick Reference

SymbolMeaning
^Start of text
$End of text
.Any character
*Zero or more
+One or more
\dDigit (0-9)
|OR operator

Escape special characters with \\ when necessary.

Installation

From Community Plugins (after approval)

  1. Open Settings → Community Plugins.
  2. Disable Safe Mode if necessary.
  3. Search for Custom Tag Color.
  4. Install and enable the plugin.

Manual Installation

Copy the following files into:

<your-vault>/.obsidian/plugins/custom-tag-color/
  • manifest.json
  • main.js

Then reload Obsidian and enable the plugin in Community Plugins.

Usage

  1. Open Settings → Custom Tag Color.
  2. Click Add New Rule.
  3. Enter a regex pattern (without the leading #).
  4. Choose a color.
  5. Save your changes.
  6. Tags matching the first applicable rule will automatically use the configured color.

Notes

  • Patterns match the tag name only, without the leading #.
  • Rules are evaluated from top to bottom.
  • The first matching rule is applied.

Compatibility

  • Minimum Obsidian version: 1.8.0

Author

Anand Baghel

License

MIT

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.