The markdown-it plugin that allows you to change the text color of Markdown.
Install via npm:
npm install markdown-it-mojicolor
Use with markdown-it:
const
md = require('markdown-it')(),
plugin = require("markdown-it-mojicolor");
md.use(plugin);
Input | Render | Description |
---|---|---|
%Tomato%{tomato} |
<span style="color: tomato;">Tomato</span> |
Specified by color. |
%Orange%{#ffa500} |
<span style="color: #ffa500;">Orange</span> |
Specified in hexadecimal. |
%café au lait%{カフェオレ} |
<span style="color: #946c45;">café au lait</span> |
Specified in Japanese, converted to hexadecimal. |
%Aqua%{rgb(0,255,255)} |
<span style="color: rgb(0,255,255);">Aqua</span> |
Specified in RGB. |
%Bisque%{hsl(33,100%,88%)} |
<span style="color: hsl(33,100%,88%);">Bisque</span> |
Specified in HSL. |
A markdown-it plugin that converts %character%{color}
to <span style="color: color">character</span>
.
Colors should be specified as color word
, hexadecimal
, RGB
or HSL
.
It also supports Japanese.
For example, if you specify カフェオレ
meaning café au lait
, it will be converted to #946c45
, which closely resembles the color of café au lait.
To find out which colors are supported, refer to Traditional Colors of Japan - Dictionary of Japanese Colors.
- Traditional Colors of Japan - Traditional Colors of Japan
- Traditional Colors of World
- Symbol Colors of Subway Metro Colors - Metro Colors
- Rail Colors
The original site (https://www.colordic.org/) has granted us permission to publish and use the site on OSS.