Java Color Brightness Get brightness(int rgb)

Here you can find the source of brightness(int rgb)

Description

brightness

License

Open Source License

Declaration

public static int brightness(int rgb) 

Method Source Code

//package com.java2s;

public class Main {
    public static int brightness(int rgb) {
        int r = (rgb >> 16) & 0xff;
        int g = (rgb >> 8) & 0xff;
        int b = rgb & 0xff;
        return (r + g + b) / 3;
    }//w ww .j a  va  2s. c om
}

Related

  1. brightness(int color)
  2. brightness(int red, int green, int blue)