Class ColorConverter

java.lang.Object
com.kheops.util.ColorConverter

public class ColorConverter extends Object
This class permits to convert color expressed in hexadecimal to decimal (int) and vice vesa
  • Constructor Details

    • ColorConverter

      public ColorConverter()
  • Method Details

    • getHexColor

      public static String getHexColor(Color color)
    • getHTMLColor

      public static String getHTMLColor(int rgb)
      This class builds the Hmtl color string from the color expressed in int
      Parameters:
      rgb - the int representing the color
    • getHTMLColor

      public static String getHTMLColor(Color color)
      This class builds the HTML color string from the color expressed in int.
      Returns:
      HTML hex color
    • getRGBColor

      public static int getRGBColor(String htmlColor)
      This method builds the int color representation from the html color string
      Parameters:
      htmlColor - the color expressed in the html string format
    • intToHex

      public static String intToHex(int n, int shift)
      This method converts an int to the corresponding hexadecimal value
      Parameters:
      n - the integer value
      shift - the number of bits to be shift
    • hexToInt

      public static int hexToInt(String hex)
      This method converts a hexadecimal number to the corresponding int value
      Parameters:
      hex - the String containing the hexadecimal number
      Returns:
      the corresponding int value.