Java examples for 2D Graphics:Color RGB
get Red from int value Color
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { int color = 2; System.out.println(getRed(color)); }// ww w.j a v a2 s . c om public static int getRed(int color) { return (color >> 16) & 0xFF; } }