Colour To Hex - Java 2D Graphics

Java examples for 2D Graphics:Color HEX

Description

Colour To Hex

Demo Code


//package com.java2s;
import java.awt.Color;

public class Main {
    /**/*from w  w w.  j a v a  2  s.com*/
     * 
     * @param c
     * @return
     */
    public static String ColourToHex(Color c) {
        String s = "#";
        String t = Integer.toHexString(c.getRGB());
        return s + t.substring(2);
    }
}

Related Tutorials