lighter Color - Android Graphics

Android examples for Graphics:Color Brighten

Description

lighter Color

Demo Code


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

public class Main {
    private static float colorDiff = 0.18f;

    public static int lighterColor(int color) {
        return changeColor(color, 1f + colorDiff);
    }//from   ww w  . j  a  v  a 2 s  .  com

    public static int changeColor(int color, float multiplier) {
        int red = Color.red(color);
        int blue = Color.blue(color);
        int green = Color.green(color);

        return Color.rgb((int) (red * multiplier),
                (int) (green * multiplier), (int) (blue * multiplier));
    }
}

Related Tutorials