get Ripple Color - Android Graphics

Android examples for Graphics:Color Operation

Description

get Ripple Color

Demo Code


import android.graphics.Color;
import android.support.annotation.ColorInt;

public class Main{
    @ColorInt/*ww  w  .  ja v  a  2  s.c  om*/
    public static int getRippleColor(@ColorInt int color) {
        float[] hsv = new float[3];
        Color.colorToHSV(color, hsv);
        hsv[2] = hsv[2] * 0.5f;
        return Color.HSVToColor(hsv);
    }
}

Related Tutorials