I have the following piece of code that colors words according to some value:

```
\documentclass{article}
\usepackage{xcolor}
\begin{document}
\colorbox{blue!0}{\strut test}
\colorbox{blue!10}{\strut test}
\colorbox{blue!20}{\strut test}
\colorbox{blue!30}{\strut test}
\colorbox{blue!40}{\strut test}
\colorbox{blue!50}{\strut test}
\colorbox{blue!60}{\strut test}
\colorbox{blue!70}{\strut test}
\colorbox{blue!80}{\strut test}
\colorbox{blue!90}{\strut test}
\colorbox{blue!100}{\strut test}
\end{document}

```

This is the output:

[![enter image description here](https://i.stack.imgur.com/qtAj8.png)](https://i.stack.imgur.com/qtAj8.png)

Is it possible to create a scale/legend that shows what color is associated with what value of the color-strength? I.e., what I want is to make a scale like this one (but horizontal, not vertical):

[![enter image description here](https://i.stack.imgur.com/t2tur.png)](https://i.stack.imgur.com/t2tur.png)

---

When I run @marmot's solution and open the PDF, this is what I see:

[![enter image description here](https://i.stack.imgur.com/pJmbV.png)](https://i.stack.imgur.com/pJmbV.png)

My tex-distribution can only run with `\pgfplotsset{compat=1.15}`, and not version 1.16 though. Can this be the cause of it?

I am opening it in Acrobat Reader DC