Class ColorConverter

java.lang.Object
org.sgrewritten.stargate.colors.ColorConverter

public final class ColorConverter extends Object
A converter for converting between different types of colors
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.md_5.bungee.api.ChatColor
    Convert from java.awt.Color to net.md_5.bungee.api.ChatColor
    static net.md_5.bungee.api.ChatColor
    getChatColorFromDyeColor(org.bukkit.DyeColor dyeColor)
    Gets the corresponding chat color for the given dye color
    static org.bukkit.DyeColor
    getClosestDyeColor(net.md_5.bungee.api.ChatColor color)
    Gets the dye-color with the closest similarity of the chat-color
    static org.bukkit.DyeColor
    getDyeColorFromMaterial(org.bukkit.Material material)
    Gets the dye color corresponding to the given dye material
    static short
    getHue(net.md_5.bungee.api.ChatColor color)
    Get the hue of a rgb format color by converting it into hsb
    static net.md_5.bungee.api.ChatColor
    getInvertedChatColor(net.md_5.bungee.api.ChatColor initialColor)
    Invert the chatColor.
    static org.bukkit.Material
    getMaterialFromDyeColor(org.bukkit.DyeColor dye)
    Gets the dye material corresponding to the given dye color

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getChatColorFromDyeColor

      public static net.md_5.bungee.api.ChatColor getChatColorFromDyeColor(org.bukkit.DyeColor dyeColor)
      Gets the corresponding chat color for the given dye color
      Parameters:
      dyeColor -

      The dye color to convert into a chat color

      Returns:

      The chat color corresponding to the given dye color

    • getDyeColorFromMaterial

      public static org.bukkit.DyeColor getDyeColorFromMaterial(org.bukkit.Material material)
      Gets the dye color corresponding to the given dye material
      Parameters:
      material -

      The material to get the dye color from

      Returns:

      The dye color corresponding to the dye material

    • getMaterialFromDyeColor

      public static org.bukkit.Material getMaterialFromDyeColor(org.bukkit.DyeColor dye)
      Gets the dye material corresponding to the given dye color
      Parameters:
      dye -

      The dye to get the dye material from

      Returns:

      The dye material

    • getInvertedChatColor

      public static net.md_5.bungee.api.ChatColor getInvertedChatColor(net.md_5.bungee.api.ChatColor initialColor)
      Invert the chatColor.
      Parameters:
      initialColor -

      The color to invert

      Returns:

      The inverted color

    • colorToChatColor

      public static net.md_5.bungee.api.ChatColor colorToChatColor(Color color)
      Convert from java.awt.Color to net.md_5.bungee.api.ChatColor
      Parameters:
      color -

      A color to convert

      Returns:

      A converted color

    • getHue

      public static short getHue(net.md_5.bungee.api.ChatColor color)
      Get the hue of a rgb format color by converting it into hsb
      Parameters:
      color -

      A color to check the hue of

      Returns:

      A hue of the color

    • getClosestDyeColor

      public static org.bukkit.DyeColor getClosestDyeColor(net.md_5.bungee.api.ChatColor color)
      Gets the dye-color with the closest similarity of the chat-color
      Parameters:
      color -

      Any chat color

      Returns:

      A dye color similar to the chat-color