Here you can find the source of RGBToInteger(int red, int green, int blue)
Parameter | Description |
---|---|
red | amount of red included (between 0 and 255 inclusive) |
green | amount of green included (between 0 and 255 inclusive) |
blue | amount of blue included (between 0 and 255 inclusive) |
public static int RGBToInteger(int red, int green, int blue)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w . j a va 2 s . c om * Converts representation of color in RGB model in triplet (r, g, b) to single number in hexadecimal system. * @param red amount of red included (between 0 and 255 inclusive) * @param green amount of green included (between 0 and 255 inclusive) * @param blue amount of blue included (between 0 and 255 inclusive) * @return hexadecimal representation of color in RGB model */ public static int RGBToInteger(int red, int green, int blue) { return 0x00000000 | (red << 16) | (green << 8) | blue; } }