darken Color - Android Graphics

Android examples for Graphics:Color

Description

darken Color

Demo Code

import android.graphics.Color;

public class Main {

  public static int darkenColor(int color) {
    float[] hsv = new float[3];
    Color.colorToHSV(color, hsv);
    hsv[2] *= 0.8f; // value component
    color = Color.HSVToColor(hsv);
    return color;
  }//from  w  w  w  . j a  v a2s .  co m
}

Related Tutorials