Class Color
java.lang.Object
com.github.retrooper.packetevents.protocol.color.Color
- All Implemented Interfaces:
net.kyori.adventure.util.RGBLike
- Direct Known Subclasses:
AlphaColor
-
Field Summary
-
Constructor Summary
ConstructorDescriptionColor
(@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 TypeMethodDescriptionint
asRGB()
@org.jetbrains.annotations.Range(from=0L, to=255L) int
blue()
static Color
decode
(NBT nbt, ClientVersion version) static NBT
encode
(Color color, ClientVersion version) @org.jetbrains.annotations.Range(from=0L, to=255L) int
green()
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
-
write
-
decode
-
encode
-
withRed
-
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 interfacenet.kyori.adventure.util.RGBLike
-
green
public @org.jetbrains.annotations.Range(from=0L, to=255L) int green()- Specified by:
green
in interfacenet.kyori.adventure.util.RGBLike
-
blue
public @org.jetbrains.annotations.Range(from=0L, to=255L) int blue()- Specified by:
blue
in interfacenet.kyori.adventure.util.RGBLike
-