get Green from int color - Java 2D Graphics

Java examples for 2D Graphics:Color

Description

get Green from int color

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        int rgb = 2;
        System.out.println(getGreen(rgb));
    }/*  ww  w .j  av  a  2 s .  com*/

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

Related Tutorials