Java Color Darker darker(int channel, int intensity)

Here you can find the source of darker(int channel, int intensity)

Description

darker

License

LGPL

Declaration

private static int darker(int channel, int intensity) 

Method Source Code


//package com.java2s;
//License from project: LGPL 

import java.awt.Color;

public class Main {
    public static Color darker(Color color, int intensity) {
        int a = color.getAlpha();
        int r = darker(color.getRed(), intensity);
        int g = darker(color.getGreen(), intensity);
        int b = darker(color.getBlue(), intensity);

        Color darker = new Color(r, g, b, a);
        return darker;
    }/*from  ww w  .  jav a  2 s  .  c  o m*/

    private static int darker(int channel, int intensity) {
        int color = channel - intensity;
        if (color < 0) {
            color = 0;
        }
        return color;
    }
}

Related

  1. darker(Color color, double fraction)
  2. darker(Color color, float fraction)
  3. darker(Color color, float ratio)
  4. darker(final Color color, final int rgbOffset)
  5. darker(final Color color, float factor)
  6. darkerColor(Color c)
  7. darkerColor(Color c, double amount)
  8. darkerColor(Color color, double factor)
  9. darkerColor(String hexValue)