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

Java examples for 2D Graphics:Color RGB

Description

Extracts the blue 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(blue(color));
    }/*ww  w  .  java  2 s.  com*/

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

Related Tutorials