README file from
GithubCustom 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
| Goal | Regex 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
| Symbol | Meaning |
|---|---|
^ |
Start of text |
$ |
End of text |
. |
Any character |
* |
Zero or more |
+ |
One or more |
\d |
Digit (0-9) |
| |
OR operator |
Escape special characters with \\ when necessary.
Installation
From Community Plugins (after approval)
- Open Settings → Community Plugins.
- Disable Safe Mode if necessary.
- Search for Custom Tag Color.
- Install and enable the plugin.
Manual Installation
Copy the following files into:
<your-vault>/.obsidian/plugins/custom-tag-color/
manifest.jsonmain.js
Then reload Obsidian and enable the plugin in Community Plugins.
Usage
- Open Settings → Custom Tag Color.
- Click Add New Rule.
- Enter a regex pattern (without the leading
#). - Choose a color.
- Save your changes.
- 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
License
MIT