java.lang.Object
com.github.retrooper.packetevents.protocol.color.Color
All Implemented Interfaces:
net.kyori.adventure.util.RGBLike
Direct Known Subclasses:
AlphaColor

public class Color extends Object implements net.kyori.adventure.util.RGBLike
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final int
     
    protected final int
     
    protected final int
     
    protected final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Color(@org.jetbrains.annotations.Range(from=0L, to=1L) float red, @org.jetbrains.annotations.Range(from=0L, to=1L) float green, @org.jetbrains.annotations.Range(from=0L, to=1L) float blue)
     
    Color(@org.jetbrains.annotations.Range(from=0L, to=255L) int red, @org.jetbrains.annotations.Range(from=0L, to=255L) int green, @org.jetbrains.annotations.Range(from=0L, to=255L) int blue)
     
    Color(int rgb)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    @org.jetbrains.annotations.Range(from=0L, to=255L) int
     
    static Color
    decode(NBT nbt, ClientVersion version)
     
    static NBT
    encode(Color color, ClientVersion version)
     
    @org.jetbrains.annotations.Range(from=0L, to=255L) int
     
    static Color
    read(PacketWrapper<?> wrapper)
     
    @org.jetbrains.annotations.Range(from=0L, to=255L) int
    red()
     
    @NotNull Color
    withBlue(@org.jetbrains.annotations.Range(from=0L, to=255L) int blue)
     
    @NotNull Color
    withGreen(@org.jetbrains.annotations.Range(from=0L, to=255L) int green)
     
    @NotNull Color
    withRed(@org.jetbrains.annotations.Range(from=0L, to=255L) int red)
     
    static void
    write(PacketWrapper<?> wrapper, Color color)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.kyori.adventure.util.RGBLike

    asHSV
  • Field Details

    • BIT_MASK

      protected static final int BIT_MASK
      See Also:
    • red

      protected final int red
    • green

      protected final int green
    • blue

      protected final int blue
  • Constructor Details

    • Color

      public Color(@org.jetbrains.annotations.Range(from=0L, to=255L) int red, @org.jetbrains.annotations.Range(from=0L, to=255L) int green, @org.jetbrains.annotations.Range(from=0L, to=255L) int blue)
    • Color

      public Color(@org.jetbrains.annotations.Range(from=0L, to=1L) float red, @org.jetbrains.annotations.Range(from=0L, to=1L) float green, @org.jetbrains.annotations.Range(from=0L, to=1L) float blue)
    • Color

      public Color(int rgb)
  • Method Details

    • read

      public static Color read(PacketWrapper<?> wrapper)
    • write

      public static void write(PacketWrapper<?> wrapper, Color color)
    • decode

      public static Color decode(NBT nbt, ClientVersion version)
    • encode

      public static NBT encode(Color color, ClientVersion version)
    • withRed

      @NotNull public @NotNull Color withRed(@org.jetbrains.annotations.Range(from=0L, to=255L) int red)
    • withGreen

      @NotNull public @NotNull Color withGreen(@org.jetbrains.annotations.Range(from=0L, to=255L) int green)
    • withBlue

      @NotNull public @NotNull Color withBlue(@org.jetbrains.annotations.Range(from=0L, to=255L) int blue)
    • asRGB

      public int asRGB()
    • red

      public @org.jetbrains.annotations.Range(from=0L, to=255L) int red()
      Specified by:
      red in interface net.kyori.adventure.util.RGBLike
    • green

      public @org.jetbrains.annotations.Range(from=0L, to=255L) int green()
      Specified by:
      green in interface net.kyori.adventure.util.RGBLike
    • blue

      public @org.jetbrains.annotations.Range(from=0L, to=255L) int blue()
      Specified by:
      blue in interface net.kyori.adventure.util.RGBLike