Package com.marcusslover.plus.lib.color
Class Color
java.lang.Object
com.marcusslover.plus.lib.color.Color
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull net.kyori.adventure.text.format.TextColorYou will need to useComponent.text(String).color(color.adventure()) and then serialize itLegacyComponentSerializer.legacySection()intalpha()intblue()@NotNull Colorbrighter(double value) Creates a brighter color.org.bukkit.Colorbukkit()@NotNull Colordarker(double value) Creates a darker color.intgreen()@NotNull Stringhex()java()@NotNull Stringlegacy()A hacky way of pre-converting the color into a bukkit translatable color.static @NotNull Colorof(float hue, float saturation, float brightness) static @NotNull Colorof(int rgb) static @NotNull Colorof(int red, int green, int blue) static @NotNull Colorstatic @NotNull Colorstatic @NotNull Colorof(@NotNull net.kyori.adventure.text.format.TextColor adventureColor) static @NotNull Colorof(org.bukkit.Color bukkitColor) @NotNull Stringplus()intred()intrgb()toString()
-
Constructor Details
-
Color
-
Color
public Color(@NotNull org.bukkit.Color bukkitColor) -
Color
-
Color
public Color(int rgb) -
Color
public Color(int red, int green, int blue) -
Color
public Color(float hue, float saturation, float brightness) -
Color
public Color(net.kyori.adventure.text.format.TextColor adventureColor)
-
-
Method Details
-
of
-
of
-
of
@NotNull public static @NotNull Color of(@NotNull @NotNull net.kyori.adventure.text.format.TextColor adventureColor) -
of
-
of
-
of
-
of
-
rgb
public int rgb() -
red
public int red() -
green
public int green() -
blue
public int blue() -
alpha
public int alpha() -
hex
- Returns:
- the hex value of the color #RRGGBB
-
plus
- Returns:
- The hex color as a format plus recognizes
-
adventure
@NotNull public @NotNull net.kyori.adventure.text.format.TextColor adventure()You will need to useComponent.text(String).color(color.adventure()) and then serialize itLegacyComponentSerializer.legacySection()- Returns:
- The Adventure API
TextColor
-
bukkit
@NotNull public org.bukkit.Color bukkit()- Returns:
- The Bukkit API
Color
-
java
- Returns:
- The Java AWT
Color
-
legacy
A hacky way of pre-converting the color into a bukkit translatable color. Note that this pretty much only works withCommandSender.sendMessage(String)- Returns:
- the converted color as a String
-
darker
Creates a darker color. Take in mind, this function does not change values of the original color instance. Instead, it creates a completely new instance of color for you.- Parameters:
value- Darkness multiplier, value between 0.0 and 1.0.- Returns:
- New, darker color.
-
brighter
Creates a brighter color. Take in mind, this function does not change values of the original color instance. Instead, it creates a completely new instance of color for you.- Parameters:
value- Brightness multiplier, value between 0.0 and 1.0.- Returns:
- New, brighter color.
-
toString
-