Java examples for 2D Graphics:Color RGB
get Red From RGB
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { int binaryColour = 2; System.out.println(getRedFromRGB(binaryColour)); }//from w ww .java2 s .c o m public static int getRedFromRGB(int binaryColour) { return (binaryColour & 0x00ff0000) >> 16; } }