change Color by multiplier - Android Graphics

Android examples for Graphics:Change Color

Description

change Color by multiplier

Demo Code


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

public class Main {
    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));
    }//from w  w  w .  j a va  2s. c om
}

Related Tutorials