Java RGB Color Convert To RGBToHex(int[] rgb)

Here you can find the source of RGBToHex(int[] rgb)

Description

RGB To Hex

License

LGPL

Declaration

public static int RGBToHex(int[] rgb) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static int RGBToHex(int[] rgb) {
        // TODO: We should really throw some sort of error here
        if (rgb.length < 3)
            return -1;
        return ((rgb[0] << 16) | (rgb[1] << 8) | rgb[2]);
    }/*from www .j  av  a2 s .c om*/
}

Related

  1. rgbToGrey(byte[] rgb)
  2. rgbToHex(final int r, final int g, final int b)
  3. rgbToHex(int r, int g, int b)
  4. RGBtoHex(int r, int g, int b)
  5. rgbToHex(int[] rgb)
  6. rgbToHex(String color)
  7. RGBtoHSB(int r, int g, int b, float hsbvals[])
  8. RGBtoHSB(int r, int g, int b, float[] hsbvals)
  9. RGBtoHSB(int red, int green, int blue, float hsb[])