Java examples for 2D Graphics:Color RGB
Extracts the red component from color .
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { int color = 2; System.out.println(red(color)); }//w w w . ja va 2 s. c o m /** * Extracts the red component from {@code color}. */ public static int red(int color) { return color & 0xff; } }