Java RGB Color Create RGBA(int r, int g, int b, int a)

Here you can find the source of RGBA(int r, int g, int b, int a)

Description

Convert to integer RGBA value

License

Open Source License

Parameter

Parameter Description
r integer red
g integer green
b integer blue
a integer alpha

Return

single integer representation of the given ints

Declaration

public static int RGBA(int r, int g, int b, int a) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*from   ww  w .  j  a va 2s  .  com*/
     * Convert to integer RGBA value
     *
     * @param r integer red
     * @param g integer green
     * @param b integer blue
     * @param a integer alpha
     *
     * @return single integer representation of the given ints
     */
    public static int RGBA(int r, int g, int b, int a) {
        return (a << 24) | ((r & 255) << 16) | ((g & 255) << 8) | (b & 255);
    }
}

Related

  1. RGB_MSE(int[] rgb1, int[] rgb2)
  2. RGB_PNSR(int[] rgb1, int[] rgb2)
  3. rgb_xyz(double r)
  4. rgba(double r, double g, double b, double a)
  5. RGBA(int r, int g, int b, float a)
  6. rgba(int red, int green, int blue)
  7. rgba_bilinear_filter(int rgb00, int rgb01, int rgb10, int rgb11, int u, int v)
  8. rgbaColour(int red, int green, int blue, int alpha)
  9. RGBAequals(float[] rgba1, float[] rgba2, float eps)