Color to ARGB - Java 2D Graphics

Java examples for 2D Graphics:Color RGB

Description

Color to ARGB

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        int a = 2;
        int r = 2;
        int g = 2;
        int b = 2;
        System.out.println(toARGB(a, r, g, b));
    }/*from www.ja  v  a  2 s . co m*/

    public static int toARGB(final int a, final int r, final int g,
            final int b) {
        return (a << 24) + (r << 16) + (g << 8) + b;
    }
}

Related Tutorials