Java RGB Color Create toRGB(int alpha, int red, int green, int blue)

Here you can find the source of toRGB(int alpha, int red, int green, int blue)

Description

to RGB

License

Open Source License

Parameter

Parameter Description
alpha a parameter
red a parameter
green a parameter
blue a parameter

Declaration

public static int toRGB(int alpha, int red, int green, int blue) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2011 MadRobot./*  w w  w  .  j  a v a 2 s  .  co m*/
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v2.1
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Contributors:
 *  Elton Kent - initial API and implementation
 ******************************************************************************/

public class Main {
    /**
     * 
     * @param alpha
     * @param red
     * @param green
     * @param blue
     * @return
     */
    public static int toRGB(int alpha, int red, int green, int blue) {
        return (alpha & 0xff) << 24 | (red & 0xff) << 16 | (green & 0xff) << 8 | (blue & 0xff) << 0;
    }
}

Related

  1. rgbFromColorInt(int c)
  2. rgbFromGrayscale(int grayscale)
  3. toRGB(byte r, byte g, byte b, byte a)
  4. toRGB(final int r, final int g, final int b, final int a)
  5. toRGB(float h, float s, float l)
  6. toRGB(int color)
  7. toRgb(int r, int g, int b)
  8. toRGB(String hexString)
  9. toRGB15(int x)