scale Color - Java 2D Graphics

Java examples for 2D Graphics:Color

Description

scale Color

Demo Code


//package com.java2s;
import java.awt.Color;

public class Main {
    public static Color scale(Color c, float s) {
        return new Color(Math.min((int) (c.getRed() * s), 255), Math.min(
                (int) (c.getGreen() * s), 255), Math.min(
                (int) (c.getBlue() * s), 255));
    }/*from   www .ja v a 2 s .c om*/
}

Related Tutorials