Get green from hex - Java 2D Graphics

Java examples for 2D Graphics:Color HEX

Description

Get green from hex

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        int parHex = 2;
        System.out.println(getGreen(parHex));
    }//  www .j av a 2  s.  co  m

    /**Get green from hex*/
    public static int getGreen(int parHex) {
        return (parHex >> 8) & 0xFF;
    }
}

Related Tutorials