Class Color

java.lang.Object
org.strassburger.colorlab4j.color.Color
Direct Known Subclasses:
HSLColor, HSVColor, LABColor, RGBColor, XYZColor

public abstract class Color extends Object
  • Constructor Details

    • Color

      public Color()
  • Method Details

    • toRGB

      public abstract RGBColor toRGB()
      Convert the color to RGB
      Returns:
      RGB representation of the color
    • toHSL

      public abstract HSLColor toHSL()
      Convert the color to HSL
      Returns:
      HSL representation of the color
    • toHSV

      public abstract HSVColor toHSV()
      Convert the color to HSV
      Returns:
      HSV representation of the color
    • toLAB

      public abstract LABColor toLAB()
      Convert the color to LAB
      Returns:
      LAB representation of the color
    • toXYZ

      public abstract XYZColor toXYZ()
      Convert the color to XYZ
      Returns:
      XYZ representation of the color
    • toHex

      public String toHex()
      Get the hex representation of the color
      Returns:
      Hex representation of the color (e.g. "#ff0000")
    • toAnsi

      public String toAnsi()
      Get the ANSI representation of the color
      Returns:
      ANSI representation of the color
    • toAnsiBackground

      public String toAnsiBackground()
      Get the ANSI representation of the color for the background
      Returns:
      ANSI representation of the color for the background
    • toCssString

      public abstract String toCssString()
      Get the CSS representation of the color
      Returns:
      CSS representation of the color