Java Color Brighten getBrightness(Color c)

Here you can find the source of getBrightness(Color c)

Description

get Brightness

License

Apache License

Declaration

public static int getBrightness(Color c) 

Method Source Code


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

import java.awt.Color;

public class Main {
    public static int getBrightness(Color c) {
        final int r = c.getRed();
        final int g = c.getGreen();
        final int b = c.getBlue();
        return (int) Math.sqrt(r * r * .241 + g * g * .691 + b * b * .068);
    }//from w ww  .  ja  v a  2s  .c  o m
}

Related

  1. changeBrightness(Color c, int percent)
  2. changeColorBrightness(final Color color, final double delta)
  3. deriveByBrightness(Color original, Color brightnessSource)
  4. deriveColorHSB(Color base, float hue, float saturation, float brightness)
  5. getBrightness(Color c)
  6. getBrightness(Color c)
  7. getBrightness(Color color)
  8. getBrightness(Color color)
  9. getBrightness(Color color)