title: Fill not-transparent part of image by color
body: <p>I have one task in Libgdx:
    Change color of image for example triangle,star, heart and others shapes.
  All shapes are given in png with transparent background.</p>
  
  <p>I'm doing this with Pixmap, checking every pixel if it is not-transparent fill pixel with needed color.
  Here is the code:</p>
  
  <pre><code>      for (int y = 0; y &lt; pixmap.getHeight(); y++) {
              for (int x = 0; x &lt; pixmap.getWidth(); x++) {
                  Color color = new Color();
  
                  Color.rgba8888ToColor(color, pixmap.getPixel(x, y));
  
                  if(color.r != 1 || color.b != 1 &amp;&amp; color.g != 1){
                      pixmap.setColor(setColor);
                      pixmap.fillRectangle(x, y, 1, 1);
                  }
              }
          }
  </code></pre>
  
  <p>Is there any other way to do this?
  Because method below works too long.</p>