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

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

Description

Converts separate RGBA values into a hexadecimal RGBA colour

License

Open Source License

Parameter

Parameter Description
red component of colour
green component of colour
blue component of colour
alpha component of colour

Return

hexadecimal RGBA colour

Declaration

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

Method Source Code

//package com.java2s;
/**/* w  w  w  .  j  a  v  a  2 s.  c  o m*/
 * Copyright (C) 2014  MudRaker
 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as 
 * published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 */

public class Main {
    /**
     * Converts separate RGBA values into a hexadecimal RGBA colour
     * @param red component of colour
     * @param green component of colour
     * @param blue component of colour
     * @param alpha component of colour
     * @return hexadecimal RGBA colour
     */
    public static int rgbaColour(int red, int green, int blue, int alpha) {
        return ((blue & 0xFF) << 0) | ((green & 0xFF) << 8) | ((red & 0xFF) << 16) | ((alpha & 0xFF) << 24);
    }
}

Related

  1. rgba(double r, double g, double b, double a)
  2. RGBA(int r, int g, int b, float a)
  3. RGBA(int r, int g, int b, int a)
  4. rgba(int red, int green, int blue)
  5. rgba_bilinear_filter(int rgb00, int rgb01, int rgb10, int rgb11, int u, int v)
  6. RGBAequals(float[] rgba1, float[] rgba2, float eps)
  7. RGBAFromHEX(String stringValue)
  8. RGBAFromHSLA(float h, float s, float l, float a)
  9. rgbClamp(float c)