public static String toHexString(Color color) {
		if (color instanceof GColor gColor) {
			return gColor.toHexString();
		}
		// this will format a color value as a 6 digit hex string (e.g. #rrggbb)
		return String.format("#%06X", color.getRGB() & 0xffffff);
	}
Returns a color string of the format #RRGGBB.  As an example, {@link Color#RED} would be
returned as #FF0000 (the values are padded with 0s to make to fill up 2 digits per
component).

@param color The color to convert.
@return a string of the format #RRGGBB.
Ghidra/Framework/Gui/src/main/java/ghidra/util/HTMLUtilities.java