How to add color to Github's README.md file

Dave Dopson picture Dave Dopson · Jul 16, 2012 · Viewed 217.1k times · Source

I have a README.md file for my project underscore-cli, a pretty sweet tool for hacking JSON and JS on the command-line.

I want to document the --color flag ... which ... colors things. That would go over a lot better if I could actually show what the output looks like. I can't seem to find a way to add color to my README.md. Any ideas?

I've tried this:

<span style="color: green"> Some green text </span>

And this:

<font color="green"> Some green text </font>

No luck so far.

Answer

AlecRust picture AlecRust · Dec 20, 2016

It's worth mentioning that you can add some colour in a README using a placeholder image service. For example if you wanted to provide a list of colours for reference:

- ![#f03c15](https://via.placeholder.com/15/f03c15/000000?text=+) `#f03c15`
- ![#c5f015](https://via.placeholder.com/15/c5f015/000000?text=+) `#c5f015`
- ![#1589F0](https://via.placeholder.com/15/1589F0/000000?text=+) `#1589F0`

Produces:

  • #f03c15 #f03c15
  • #c5f015 #c5f015
  • #1589F0 #1589F0