Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.graphics.Color;

public class Main {
    public static int setColorLightness(int color, float light) {
        float[] hsv = new float[3];
        Color.colorToHSV(color, hsv);
        hsv[2] *= Math.min(light, 1f); // value component
        return Color.HSVToColor(hsv);
    }
}