Java Color to Hex toHexString(Color color)

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

Description

to Hex String

License

Open Source License

Declaration

public static String toHexString(Color color) 

Method Source Code


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

import java.awt.*;

public class Main {
    public static String toHexString(Color color) {
        return String.format("#%06x", (color.getRGB() & 0x00ffffff));
    }//from   w  w  w.j ava  2s .co  m
}

Related

  1. toHexColor(final Color color)
  2. toHexColor(final Color color)
  3. toHexString(Color c)
  4. toHexString(Color col)
  5. toHexString(Color col)
  6. toHexString(Color color)
  7. toHexString(Color color)
  8. toHexString(Color color)
  9. toHexString(final Color aColor)