Extracts the green component from color . - Java 2D Graphics

Java examples for 2D Graphics:Color

Description

Extracts the green component from color .

Demo Code


//package com.java2s;

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

    /**
     * Extracts the green component from {@code color}.
     */
    public static int green(int color) {
        return (color >> 8) & 0xff;
    }
}

Related Tutorials