Class CssColors


  • public final class CssColors
    extends java.lang.Object
    Helper to work with colors.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Map<java.lang.String,​java.lang.String> CSSColors_  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private CssColors()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isColorKeyword​(java.lang.String token)
      Returns if the specified token is a reserved color keyword.
      static java.lang.String toRGBColor​(java.lang.String color)
      Gets the RGB equivalent of a CSS color if the provided color is recognized.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • CSSColors_

        private static final java.util.Map<java.lang.String,​java.lang.String> CSSColors_
    • Constructor Detail

      • CssColors

        private CssColors()
    • Method Detail

      • isColorKeyword

        public static boolean isColorKeyword​(java.lang.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 java.lang.String toRGBColor​(java.lang.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