Java RGB Color Convert To RGBToInt(float[] rgb)

Here you can find the source of RGBToInt(float[] rgb)

Description

RGB To Int

License

Open Source License

Declaration

public static int RGBToInt(float[] rgb) 

Method Source Code

//package com.java2s;

public class Main {
    public static int RGBToInt(float[] rgb) {
        byte[] argb = { (byte) 0xFF, (byte) (rgb[0] * 0xFF), (byte) (rgb[1] * 0xFF), (byte) (rgb[2] * 0xFF) };
        return (argb[0] << 24) + ((argb[1] & 0xFF) << 16) + ((argb[2] & 0xFF) << 8) + (argb[3] & 0xFF);
    }//  w  w w .  j  a v  a2s.  c  om
}

Related

  1. rgbToHsv(int red, int green, int blue)
  2. RGBtoHSV(int red, int green, int blue)
  3. RGBToHSV(int red, int green, int blue, float[] hsv)
  4. rgbToHsv(int rgb)
  5. RGBtoHTML(int rgb)
  6. RGBtoInt(int r, int g, int b)
  7. RGBtoInt(int red, int green, int blue)
  8. RGBtoInt(String rgb)
  9. RGBToInteger(int red, int green, int blue)