Java Color Darker darken(Color col)

Here you can find the source of darken(Color col)

Description

darken

License

Open Source License

Declaration

private static Color darken(Color col) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.Color;

public class Main {
    private static Color darken(Color col) {
        float[] hsv = Color.RGBtoHSB(col.getRed(), col.getGreen(),
                col.getBlue(), null);//from   w w  w  . ja  va  2s  .c  o  m
        hsv[2] = hsv[2] * 0.4f;
        int newCol = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);
        return new Color(newCol);
    }
}

Related

  1. darken(Color c, double f)
  2. darken(final Color color, final double percentage)
  3. darken(final Color color, final int amount)
  4. darkenColor(Color color)
  5. darker(Color c)