public class RGBUtil
extends java.lang.Object
| Constructor | Description |
|---|---|
RGBUtil() |
| Modifier and Type | Method | Description |
|---|---|---|
static int |
packRGB(int[] rgb) |
Packs the RGB array into one int for storing into db or sending via network.
|
static int[] |
packRGBArray(int[][] rgbArray) |
|
static int[] |
unpackRGB(int packedRgb) |
Unpacks RGB array from the given int, e.g. received from calling
packRGB(int[])). |
static int[][] |
unpackRGBArray(int[] packedRgbArray) |
public static int packRGB(int[] rgb)
rgb - array containing red, green and blue values of the color to encodejava.lang.IllegalArgumentException - if rgb has not exactly 3 elementspublic static int[] unpackRGB(int packedRgb)
packRGB(int[])).packedRgb - value containing RGBpublic static int[] packRGBArray(int[][] rgbArray)
rgbArray - the array of arrays containing unpacked RGB valuesjava.lang.IllegalArgumentException - if at least one of rgb has not exactly 3 elementspublic static int[][] unpackRGBArray(int[] packedRgbArray)
packedRgbArray - the array of packed RGB valuesCopyright © 2018. All rights reserved.