Here you can find the source of rgbaColour(int red, int green, int blue, int alpha)
Parameter | Description |
---|---|
red | component of colour |
green | component of colour |
blue | component of colour |
alpha | component of colour |
public static int rgbaColour(int red, int green, int blue, int alpha)
//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); } }