Class Colors

java.lang.Object
se.datadosen.util.Colors

public class Colors
extends java.lang.Object
Utility Color class
  • Method Summary

    Modifier and Type Method Description
    static java.awt.Color getHTMLColor​(java.lang.String htmlColor)
    Parse color strings in the #rrggbb hex format and standard html color string format Also handle comma-separated list of r,g,b,(a) integer values
    static java.lang.String toARGBHexColor​(java.awt.Color c)
    Return color in Java's ARGB format If color is fully opaque, use classic rgb format
    static java.lang.String toHTMLColor​(java.awt.Color c)
    Convert a Color to its HTML hex representation in the #rrggbb format
    static java.lang.String toRGBAHexColor​(java.awt.Color c)
    Return color in the new HTML rgba format If color is fully opaque, use classic rgb format

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getHTMLColor

      public static java.awt.Color getHTMLColor​(java.lang.String htmlColor) throws java.lang.IllegalArgumentException
      Parse color strings in the #rrggbb hex format and standard html color string format Also handle comma-separated list of r,g,b,(a) integer values
      Parameters:
      htmlColor -
      Returns:
      Throws:
      java.lang.IllegalArgumentException
    • toHTMLColor

      public static java.lang.String toHTMLColor​(java.awt.Color c)
      Convert a Color to its HTML hex representation in the #rrggbb format
      Since:
      8.6.1
    • toRGBAHexColor

      public static java.lang.String toRGBAHexColor​(java.awt.Color c)
      Return color in the new HTML rgba format If color is fully opaque, use classic rgb format
      Parameters:
      c -
      Returns:
      Since:
      15.1.3
    • toARGBHexColor

      public static java.lang.String toARGBHexColor​(java.awt.Color c)
      Return color in Java's ARGB format If color is fully opaque, use classic rgb format
      Parameters:
      c -
      Returns:
      Since:
      23.3