title: android drawable color matrix
body: <p>I have BitmapDrawable</p>
  
  <p>I draw it on the screen</p>
  
  <p>I have 4 seekbar (contrast, brightness, hue, saturation)</p>
  
  <p>I change contrast of BitmapDrawable like this:</p>
  
  <pre><code>public void setContrast(float mAngle) {
  ColorMatrix matrix = new ColorMatrix();
  
      float contrast = mAngle / 180.f;
  
              float scale = contrast + 1.f;
      float translate = (-.5f * scale + .5f) * 255.f;
  
      float[] cntr = new float[] { scale, 0, 0, 0, translate, 0, scale, 0, 0, translate, 0, 0,
              scale, 0, translate, 0, 0, 0, 1, 0 };
  
              matrix.set(cntr);
  
      drawable.setColorFilter(new ColorMatrixColorFilter(matrix));
  }
  </code></pre>
  
  <p>and change hue of BitmapDrawable like this:</p>
  
  <pre><code>public void setHue(float value {
       ColorMatrix matrix = new ColorMatrix();  
  
   value = cleanValue(value, 180f) / 180f * (float) Math.PI;
      if (value == 0) {
          return;
      }
      float cosVal = (float) Math.cos(value);
      float sinVal = (float) Math.sin(value);
      float lumR = 0.213f;
      float lumG = 0.715f;
      float lumB = 0.072f;
      float[] fmatrix = new float[] { lumR + cosVal * (1 - lumR) + sinVal * (-lumR),
              lumG + cosVal * (-lumG) + sinVal * (-lumG),
              lumB + cosVal * (-lumB) + sinVal * (1 - lumB), 0, 0,
              lumR + cosVal * (-lumR) + sinVal * (0.143f),
              lumG + cosVal * (1 - lumG) + sinVal * (0.140f),
              lumB + cosVal * (-lumB) + sinVal * (-0.283f), 0, 0,
              lumR + cosVal * (-lumR) + sinVal * (-(1 - lumR)),
              lumG + cosVal * (-lumG) + sinVal * (lumG),
              lumB + cosVal * (1 - lumB) + sinVal * (lumB), 0, 0, 0f, 0f, 0f, 1f, 0f, 0f, 0f, 0f,
              0f, 1f };
  
           matrix.postConcat(new ColorMatrix(fmatrix));
  
       drawable.setColorFilter(new ColorMatrixColorFilter(matrix));
      }
  
       protected float cleanValue(float p_val, float p_limit) {
         return Math.min(p_limit, Math.max(-p_limit, p_val));
  }
  </code></pre>
  
  <p>they works fine, but I want to  work together  , is there way to do it?</p>