title: Number color according to its value in LaTeX
body: <p>I need to create a table with numeric content, and based on its value, I require it to automatically take a color. For example. if X take the following values:</p>
  
  <pre><code>x &lt; 0; then x will be red
  0 &lt;= x &lt; 0.5; then x will be green
  0.5 &lt;= x &lt;= 1; then x will be blue
  </code></pre>
  
  <p>ie: if I create a table with the following </p>
  
  <pre><code>\documentclass{article}
  \begin{document}
  \begin{table}[]
  \begin{tabular}{ccc}
  \hline\\
  \textbf{a} &amp; \textbf{b} &amp; \textbf{c} \\
  \hline\\
  -1   &amp; 0   &amp; 1    \\
  0.3  &amp; 0.5 &amp; -1   \\
  -0.2 &amp; 0.7   &amp; -0.5 \\
  \hline\\
  \end{tabular}
  \end{table}
  \end{document}
  </code></pre>
  
  <p>then the output should be:</p>
  
  <p><a href="https://i.stack.imgur.com/ebSSm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ebSSm.png" alt="enter image description here"></a></p>
  
  <p>but automatically, I know that it can be done by programming with tex but I do not know where to start. Please, any suggestion is welcome</p>