brighten color by brightness - Android Graphics

Android examples for Graphics:Color Brighten

Description

brighten color by brightness

Demo Code


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

public class Main {
    public static int brighten(int color, float brightness) {
        float[] hsv = new float[3];
        Color.RGBToHSV(Color.red(color), Color.green(color),
                Color.blue(color), hsv);
        hsv[2] = brightness;/*from  w  w  w .j  a  v  a  2s  .  c o  m*/
        return Color.HSVToColor(Color.alpha(color), hsv);
    }
}

Related Tutorials