brighter Color 2 times - Android Graphics

Android examples for Graphics:Color Brighten

Description

brighter Color 2 times

Demo Code


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

public class Main {
    public static int brighter2times(final int color) {
        final int a = Color.alpha(color);
        int r = Color.red(color);
        int g = Color.green(color);
        int b = Color.blue(color);

        r += 64;//w  ww  . j a  v a  2s .com
        if (r > 255) {
            r = 255;
        }
        g += 64;
        if (g > 255) {
            g = 255;
        }
        b += 64;
        if (b > 255) {
            b = 255;
        }

        return Color.argb(a, r, g, b);
    }
}

Related Tutorials