Here you can find the source of getDarkerLine(Color c, float alternateRowDarkerFactor)
public static Color getDarkerLine(Color c, float alternateRowDarkerFactor)
//package com.java2s; //License from project: Open Source License import java.awt.Color; public class Main { public static Color getDarkerLine(Color c, float alternateRowDarkerFactor) { return getSafeColor((int) (c.getRed() * alternateRowDarkerFactor), (int) (c.getGreen() * alternateRowDarkerFactor), (int) (c.getBlue() * alternateRowDarkerFactor)); }//from ww w . jav a2 s. c o m public static Color getSafeColor(int red, int green, int blue) { red = Math.max(red, 0); red = Math.min(red, 255); green = Math.max(green, 0); green = Math.min(green, 255); blue = Math.max(blue, 0); blue = Math.min(blue, 255); return new Color(red, green, blue); } }