Class ColorFactory

java.lang.Object
org.loboevolution.laf.ColorFactory

public final class ColorFactory extends Object
A factory for creating Color objects.
  • Method Details

    • getInstance

      public static ColorFactory getInstance()
      Gets the instance.
      Returns:
      the instance
    • getColor

      public Color getColor(LAFColorType colorSpec)
      Gets the color.
      Parameters:
      colorSpec - the color spec
      Returns:
      the color
    • getColor

      public Color getColor(String colorSpec)
      Gets the color.
      Parameters:
      colorSpec - the color spec
      Returns:
      the color
    • getColorString

      public String getColorString(HTMLElement element, String colorSpec, String defaultValue)
      Gets the color string.
      Parameters:
      element - a HTMLElement object.
      colorSpec - a String object.
      defaultValue - a String object.
      Returns:
      the color
    • isColor

      public boolean isColor(String colorSpec)
      Checks if is color.
      Parameters:
      colorSpec - the color spec
      Returns:
      true, if is color
    • isRgbOrHsl

      public boolean isRgbOrHsl(String colorSpec)

      isRgbOrHsl.

      Parameters:
      colorSpec - a String object.
      Returns:
      a boolean.
    • getAdjustedColor

      public static Color getAdjustedColor(Color c, double factor)

      getAdjustedColor.

      Parameters:
      c - a Color object.
      factor - a double.
      Returns:
      a Color object.