Package org.sgrewritten.stargate.colors
Class ColorConverter
java.lang.Object
org.sgrewritten.stargate.colors.ColorConverter
A converter for converting between different types of colors
-
Method Summary
Modifier and TypeMethodDescriptionstatic net.md_5.bungee.api.ChatColor
colorToChatColor
(Color color) Convert from java.awt.Color to net.md_5.bungee.api.ChatColorstatic net.md_5.bungee.api.ChatColor
getChatColorFromDyeColor
(org.bukkit.DyeColor dyeColor) Gets the corresponding chat color for the given dye colorstatic org.bukkit.DyeColor
getClosestDyeColor
(net.md_5.bungee.api.ChatColor color) Gets the dye-color with the closest similarity of the chat-colorstatic org.bukkit.DyeColor
getDyeColorFromMaterial
(org.bukkit.Material material) Gets the dye color corresponding to the given dye materialstatic short
getHue
(net.md_5.bungee.api.ChatColor color) Get the hue of a rgb format color by converting it into hsbstatic 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
-
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
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
-