Java Color Darker getDarkerLine(Color c, float alternateRowDarkerFactor)

Here you can find the source of getDarkerLine(Color c, float alternateRowDarkerFactor)

Description

get Darker Line

License

Open Source License

Declaration

public static Color getDarkerLine(Color c, float alternateRowDarkerFactor) 

Method Source Code


//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);
    }
}

Related

  1. getDarker(Color c)
  2. getDarker(Color color)
  3. getDarker(Color color, double factor)
  4. getDarkerColor(Color color)
  5. getDarkerColor(Color color, double diff)
  6. getLineDarkColor()
  7. initializePattern(Color light, Color dark)
  8. makeDarker(final Color color, final double percentage)
  9. reallyDark(Color c)