Package ch.njol.skript.util
Class ColorRGB
java.lang.Object
ch.njol.skript.util.ColorRGB
- All Implemented Interfaces:
Color,YggdrasilSerializable,YggdrasilSerializable.YggdrasilExtendedSerializable
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.njol.yggdrasil.YggdrasilSerializable
YggdrasilSerializable.YggdrasilExtendedSerializable, YggdrasilSerializable.YggdrasilRobustEnum, YggdrasilSerializable.YggdrasilRobustSerializable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets Bukkit color representing this color.@Nullable DyeColorGets Bukkit dye color representing this color, if one exists.voiddeserialize(Fields fields) Deserializes this object.static @Nullable ColorRGBfromString(String string) getName()Serialises this object.
-
Constructor Details
-
ColorRGB
public ColorRGB(int red, int green, int blue)
-
-
Method Details
-
asBukkitColor
Description copied from interface:ColorGets Bukkit color representing this color.- Specified by:
asBukkitColorin interfaceColor- Returns:
- Bukkit color.
-
asDyeColor
Description copied from interface:ColorGets Bukkit dye color representing this color, if one exists.- Specified by:
asDyeColorin interfaceColor- Returns:
- Dye color or null.
-
getName
-
fromString
-
serialize
Description copied from interface:YggdrasilSerializable.YggdrasilExtendedSerializableSerialises this object. Only fields contained in the returned Fields object will be written to stream.You can use return new
Fields(this); to emulate the default behaviour.- Specified by:
serializein interfaceYggdrasilSerializable.YggdrasilExtendedSerializable- Returns:
- A Fields object containing all fields that should be written to stream
- Throws:
NotSerializableException- If this object or one of its fields is not serializable
-
deserialize
Description copied from interface:YggdrasilSerializable.YggdrasilExtendedSerializableDeserializes this object. No fields have been set when this method is called, use fields.setFields(this, yggdrasil) to set all compatible non-transient and non-static fields (and call incompatible/missing field handlers if applicable – this implies that errors will be thrown if the fields object is invalid).You can use fields.
setFields(this); to emulate the default behaviour.- Specified by:
deserializein interfaceYggdrasilSerializable.YggdrasilExtendedSerializable- Parameters:
fields- A Fields object containing all fields read from stream- Throws:
StreamCorruptedException- If the Fields object is invalid, i.e. was not written byYggdrasilSerializable.YggdrasilExtendedSerializable.serialize()or Yggdrasil's default serialisation.NotSerializableException
-