Java Color to Hex toHex(Color color)

Here you can find the source of toHex(Color color)

Description

to Hex

License

LGPL

Declaration

public static int toHex(Color color) 

Method Source Code

//package com.java2s;
/**//from   w ww .j  av a  2  s.  c o  m
 * This class is part of the Gadomancy Mod
 * Gadomancy is Open Source and distributed under the
 * GNU LESSER GENERAL PUBLIC LICENSE
 * for more read the LICENSE file
 *
 * Created by makeo @ 13.07.2015 03:50
 */

import java.awt.*;

public class Main {
    public static int toHex(int red, int green, int blue) {
        return (red << 16) | (green << 8) | (blue);
    }

    public static int toHex(Color color) {
        return toHex(color.getRed(), color.getGreen(), color.getBlue());
    }
}

Related

  1. toHex(Color color)
  2. toHex(Color color)
  3. toHex(Color color)
  4. toHex(Color color)
  5. toHex(Color color)
  6. toHex(java.awt.Color color)
  7. toHex0x(Color col)
  8. toHexCode(String prefix, Color color)
  9. toHexColor(Color col)