README file from
GithubColorez - Obsidian Plugin
Colorez is a minimal and polished plugin for Obsidian that lets you easily change text color using your active theme's colors.
Instead of hardcoding hex values or messing with raw HTML tags, Colorez wraps your selected text with Obsidian's dynamic CSS variables (e.g., var(--color-red)). This ensures that your colored text looks beautiful and adapts perfectly even if you switch Obsidian themes.
Features
- Native Right-Click Menu: Select text, right-click, and hover over
Change colororHighlight textto pick from your theme's palette. - Highlighting: Easily highlight text with matching background colors that include transparency and smooth rounded corners.
- Color Previews: See exactly what a color looks like with tiny color circle previews directly in the context menu.
- Theme Adapting: Uses standard Obsidian CSS variables (Red, Blue, Accent, Normal, Muted, etc.) so your text changes seamlessly when switching from dark to light mode or installing new themes.
- Easy Removal: An "Eraser" option lets you quickly remove color styling from previously colored text without leaving nested HTML span tags.
- Commands: Available via the Command Palette so you can assign hotkeys (e.g.,
Ctrl+Shift+Cto open the palette and apply color instantly).
How to use
- Select some text in your Obsidian editor.
- Right-click on the selection.
- Hover over the Change color menu item and click your preferred color from the submenu.
- To remove color, select the colored text, right-click, and select Remove color.
Installation
From Community Plugins
You can install Colorez directly from within Obsidian:
- Open Obsidian Settings -> Community plugins.
- Ensure Restricted mode is turned off.
- Click Browse and search for "Colorez".
- Click Install and then Enable.
Manual Installation
- Download the latest release (
main.js,manifest.json,styles.css) from the Releases page of this repository. - Copy these 3 files into your vault under
.obsidian/plugins/colorez/. - Restart Obsidian.
- Go to Settings -> Community plugins and enable Colorez.
Development
This project uses modern tooling, powered by Bun and TypeScript.
Requirements
- Bun (latest version recommended)
Getting Started
- Clone this repository into your Obsidian vault's plugin directory:
cd .obsidian/plugins/ git clone https://github.com/didacd/colorez.git cd colorez - Install dependencies using Bun:
bun install - Run the development server (watches for changes and compiles automatically):
bun run dev - Reload Obsidian to see your changes in action.
Building & Linting
To produce a production build:
bun run build
To run the linter and ensure code quality:
bun run lint
Contributing
Contributions are welcome! If you want to add new features (such as supporting background colors) or fix a bug:
- Fork this repository.
- Create a new branch.
- Make your changes and ensure they pass linting (
bun run lint). - Commit your changes.
- Push to the branch.
- Open a Pull Request on GitHub.
Releasing (For Maintainers)
The release process is automated via GitHub Actions.
- Run the version bump script:
This updatesbun run version 1.0.3manifest.jsonandversions.json, and stages them. - Commit the changes and tag the release:
git commit -m "bump version" git tag 1.0.3 - Push to trigger the release workflow:
git push origin main --tags
License
This project is open source and available under the terms of the License.