Class CssColors

java.lang.Object
org.htmlunit.css.CssColors

public final class CssColors extends Object
Helper to work with colors.
  • Field Details

  • Constructor Details

    • CssColors

      private CssColors()
  • Method Details

    • isColorKeyword

      public static boolean isColorKeyword(String token)
      Returns if the specified token is a reserved color keyword.
      Parameters:
      token - the token to check
      Returns:
      whether the token is a reserved color keyword or not
    • toRGBColor

      public static String toRGBColor(String color)
      Gets the RGB equivalent of a CSS color if the provided color is recognized.
      Parameters:
      color - the color
      Returns:
      the provided color if this is not a recognized color keyword, the RGB value in the form "rgb(x, y, z)" otherwise