get Darker Color via HSV - Android Graphics

Android examples for Graphics:Color Darken

Description

get Darker Color via HSV

Demo Code


//package com.java2s;
import android.graphics.Color;

public class Main {
    public static int getDarkerColor(int color) {
        float[] hsv = new float[3];
        Color.colorToHSV(color, hsv);
        hsv[2] *= 0.9F;/*from   w  ww  .j av  a 2  s .c o m*/
        return Color.HSVToColor(hsv);
    }
}

Related Tutorials