title: Android ColorFilter - Porter-Duff Modes
body: <p>I'm trying to solve a problem with android <code>ColorFilters</code>. Documentation is very poor, so the main method is trying different variants.</p>
  
  <p>The problem:</p>
  
  <p>There is a Bitmap. Some pixels have alpha=255, others have alpha=0. I'm trying to draw a circle with a specific color. I want alpha channel unchanged in the bitmap, but while drawing I want to multiply a color to the bitmap-alpha. </p>
  
  <p>So, while drawing a circle I want pixels with alpha=0 to be not painted, but pixels with alpha=255 to be painted in color which I want. Alpha channel shouldn't change.</p>
  
  <p>I'm trying to use porter-duff ColorFilter (PorterDuffColorFilter class in android sdk).</p>
  
  <p>there are too many modes and no-understandable description on official site here : <a href="http://developer.android.com/reference/android/graphics/PorterDuff.Mode.html">http://developer.android.com/reference/android/graphics/PorterDuff.Mode.html</a></p>
  
  <p>I think I should use <code>DST_ATOP</code> or <code>SRC_ATOP</code>, but they don't work as I described.</p>
  
  <p>Also, there is a strange parameter <code>srcColor</code> in constructor of porter-duff colorfilter.</p>
  
  <p>I can't understand what "Sa" and "Sc" means in formulas <code>[Da, Sc * Da + (1 - Sa) * Dc]</code>. It can be from color which was passed into colorfilter constructor and also it can be color set by "paint.setColor". </p>
  
  <p>Anybody knows, how it works?</p>