Java Color to HTML toHtmlHex(Color color)

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

Description

to Html Hex

License

Apache License

Declaration

public static String toHtmlHex(Color color) 

Method Source Code


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

import java.awt.Color;

public class Main {
    public static String toHtmlHex(Color color) {
        return String.format("#%02x%02x%02x", color.getRed(), color.getGreen(), color.getBlue());
    }// w  w  w .j  a v a 2s. co m
}

Related

  1. covertToHtmlColor(Color color)
  2. toHTMLColor(Color c)
  3. toHTMLColor(Color c)
  4. toHtmlColor(Color color)
  5. toHtmlColor(Color color)
  6. toHtmlRGB(Color col)
  7. toHtmlString(Color color)