Paint text different colors
Inspired by my css snippet & data.json to use Highlightr to change text color.
The aim of this plugin is to support most features of Highlightr-Plugin as well as changing of the text color.
text-color
higlight optionminimal
menu style - only show icons in one line (with title
attributes)Inline code
signifies the part of the text being selected. |
is a cursor without selection.|
here world!" => "hello there
world!"is
up?" => "what is
up?"ell
o" => "hell
o"Clear
(formerly Remove higlight
) command
mark
elementsDOMParser
wait()
calls (promise + settimeout) pickr
- Replaced with obsidian's native color picker & an alpha slider"use strict"
to minified code to improve performanceIf you find this Plugin helpful, consider it's further development or just say a small thank you
If you've previously used the highlightr plugin, you can migrate your settings by copying:
<vault>/.obsidian/plugins/highlightr-plugin/data.json
=><vault>/.obsidian/plugins/painter/data.json
Then, disable & enable the Painter plugin. Make sure to check settings have sucessfully migrated, and if they have, feel free to uninstall highlightr.
The settings allow you to select between two highlight styles, css-classes
and inline-styles
.
Here is their comparison:
<mark class="hltr-colorname">content</mark>
Unless you plan on frequently exporting your notes outside of obsidian, use Obsidian Publish or edit notes in externally, pick this option. It's much more flexible.
Even if you plan to someday export your notes, you can always write a simple script to convert the <mark>
elements to whatever you want, or add a custom stylesheet that will add back their coloring.
In a future plugin release, there will likely be an option to generate this stylesheet for usage outside of obsidian.
<mark style="color:#hex">content</mark>
or <mark style="background-color:#hex">content</mark>
background-color
highlights will not turn into color
(text-color
in settings) and vice versa.Some people might prefer this method, so i kept it in.
Feel free to experiment with them to find the one best for your use-case.
If your context menu looks like this and not like the one in the screenshots above, in Obsidian settings, Appearance
> Advanced
, turn off Native menus
.
This plugin is for coloring/highlighting text.
It doesen't try to provide a comprehensive formatting toolbar/experience.
Out of scope: Modal highlighting (highlighting brushes)
Use this: obsidian-editing-toolbar