Java RGB Color Convert To RGBtoHex(int r, int g, int b)

Here you can find the source of RGBtoHex(int r, int g, int b)

Description

RG Bto Hex

License

Open Source License

Declaration

public static String RGBtoHex(int r, int g, int b) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String RGBtoHex(int r, int g, int b) {
        String val = Integer.toHexString(r << 16 | g << 8 | b);
        while (val.length() < 6)
            val = "0" + val;
        return val;
    }//from   ww w  .  j  a  va  2 s. c  om
}

Related

  1. rgbToGray(int colorIn)
  2. rgbToGray(int pixels)
  3. RgbToGray(int r, int g, int b)
  4. rgbToGrey(byte[] rgb)
  5. rgbToHex(final int r, final int g, final int b)
  6. rgbToHex(int r, int g, int b)
  7. rgbToHex(int[] rgb)
  8. RGBToHex(int[] rgb)
  9. rgbToHex(String color)