Java Color Darker darker(Color c, double factor)

Here you can find the source of darker(Color c, double factor)

Description

darker

License

Open Source License

Declaration

public static Color darker(Color c, double factor) 

Method Source Code

//package com.java2s;
/*//from   ww w. j av  a  2s .co  m
 * @(#)QuaquaUtilities.java
 *
 * Copyright (c) 2003-2013 Werner Randelshofer, Switzerland.
 * You may not use, copy or modify this file, except in compliance with the
 * accompanying license terms.
 */

import java.awt.*;

public class Main {
    public static Color darker(Color c, double factor) {
        return new Color(Math.max((int) (c.getRed() * factor), 0),
                Math.max((int) (c.getGreen() * factor), 0), Math.max(
                        (int) (c.getBlue() * factor), 0), c.getAlpha());
    }
}

Related

  1. darken(final Color color, final double percentage)
  2. darken(final Color color, final int amount)
  3. darkenColor(Color color)
  4. darker(Color c)
  5. darker(Color c)
  6. darker(Color c, double p)
  7. darker(Color c, double p)
  8. darker(Color c, float factor)
  9. darker(Color col, double FACTOR)