get Green from int value Color - Java 2D Graphics

Java examples for 2D Graphics:Color RGB

Description

get Green from int value Color

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        int color = 2;
        System.out.println(getGreen(color));
    }/*w w  w  .j  a va 2 s . c  o m*/

    public static int getGreen(int color) {
        return (color >> 8) & 0xFF;
    }
}

Related Tutorials