Here you can find the source of IntToRGB(int rgbInt)
Parameter | Description |
---|---|
rgbInt | RGB integer value |
public static int[] IntToRGB(int rgbInt)
//package com.java2s; //License from project: LGPL public class Main { /**/*from w w w . j av a 2s . c o m*/ * Converts an RGB integer value into an array of RGB values. * * @param rgbInt RGB integer value * @return Array containing RGB values in the format {r,g,b} */ public static int[] IntToRGB(int rgbInt) { int r = (int) (rgbInt / 256.0 / 256.0 % 256); int g = (int) (rgbInt / 256.0 % 256); int b = (int) (rgbInt % 256); return new int[] { r, g, b }; } }