title: Match colors in feColorMatrix filter
body: <p>I have a greyscale image. I want to filter it such that <code>white -&gt; color1</code> and <code>black -&gt; color2</code>. Both colors are in hex CSS syntax. What math do I need to do to get this effect?</p>
  
  <p>I'm using this syntax:</p>
  
  <pre><code>&lt;!-- just an example --&gt;
  &lt;filter id="colorMeMatrix"&gt;
    &lt;feColorMatrix in="SourceGraphic"
      type="matrix"
      values="0 0 0 0 0
              1 1 1 1 0
              0 0 0 0 0
              0 0 0 1 0" /&gt;
  </code></pre>
  
  <p></p>