Java Color Darker getDarker(Color color)

Here you can find the source of getDarker(Color color)

Description

get Darker

License

Open Source License

Declaration

public static Color getDarker(Color color) 

Method Source Code


//package com.java2s;
/*/*  w ww  . j a  v  a2  s  .com*/
Moenagade
?????????
    
Moenagade is a graphical programming tool for beginners. For this
reason it is rather limited in its functionality. It aims to help
students to gain knowledge about the programming structures. Due
to the explicit conversion to real and executable Java code, it 
should help to make an easy from block programming to coding.
    
Copyright (C) 2009  Bob Fisch
    
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or any
later version.
    
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
    
You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

import java.awt.Color;

public class Main {
    public static Color getDarker(Color color) {
        float hsbVals[] = Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), null);
        return Color.getHSBColor(hsbVals[0], hsbVals[1], 0.8f * hsbVals[2]);
    }
}

Related

  1. deriveColor(Color orig, int darker)
  2. draw3DFrame(Graphics g, Rectangle rect, Color colorBackground, Color colorDark, Color colorLight)
  3. getDarkColor()
  4. getDarkColors(Color[] colors, double fraction)
  5. getDarker(Color c)
  6. getDarker(Color color, double factor)
  7. getDarkerColor(Color color)
  8. getDarkerColor(Color color, double diff)
  9. getDarkerLine(Color c, float alternateRowDarkerFactor)