Class ColorUtil

java.lang.Object
overit.geocall.ux.util.ColorUtil

public class ColorUtil extends Object
Class to create a Color from a string that rappresents the code of the color in hexadecimal.
  • Method Details

    • toColor

      public static Color toColor(String s)
      Method to return the Color from the string. The string must be write in hexadecimal encoding. It can be preceded by the '#' character, but it is not obligatory.
      The code can be composed of six digits representing the rgb code, or of eight digits for the argb code (where 'a' means alpha channel for the opacity).
      Each element of the code must be represented with two hexadecimal digits, so the possible value range from "00" to "FF" (from 0 to 255 in decimal).
      Parameters:
      s - String contains the color code. It may contain the code in rgb or in argb format, and can be preceded by the '#' character.
      Returns:
      The color coded by the parameter.