Class OrdinaryColor
java.lang.Object
dev.esophose.playerparticles.particles.data.ParticleColor
dev.esophose.playerparticles.particles.data.OrdinaryColor
public final class OrdinaryColor extends ParticleColor
Represents the color for effects like
ParticleEffect.ENTITY_EFFECT
,
ParticleEffect.AMBIENT_ENTITY_EFFECT
and ParticleEffect.NOTE
This class is part of the ParticleEffect Library and follows the same usage conditions
- Since:
- 1.7
-
Field Summary
Fields Modifier and Type Field Description static OrdinaryColor
RAINBOW
static OrdinaryColor
RANDOM
-
Constructor Summary
Constructors Constructor Description OrdinaryColor(int red, int green, int blue)
Construct a new ordinary color -
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object other)
int
getBlue()
Returns the blue value of the RGB formatint
getGreen()
Returns the green value of the RGB formatint
getRed()
Returns the red value of the RGB formatfloat
getValueX()
Returns the red value divided by 255float
getValueY()
Returns the green value divided by 255float
getValueZ()
Returns the blue value divided by 255int
hashCode()
org.bukkit.Color
toSpigot()
-
Field Details
-
Constructor Details
-
OrdinaryColor
public OrdinaryColor(int red, int green, int blue) throws java.lang.IllegalArgumentExceptionConstruct a new ordinary color- Parameters:
red
- Red value of the RGB formatgreen
- Green value of the RGB formatblue
- Blue value of the RGB format- Throws:
java.lang.IllegalArgumentException
- If one of the values is lower than 0 or higher than 255
-
-
Method Details
-
getRed
public int getRed()Returns the red value of the RGB format- Returns:
- The red value
-
getGreen
public int getGreen()Returns the green value of the RGB format- Returns:
- The green value
-
getBlue
public int getBlue()Returns the blue value of the RGB format- Returns:
- The blue value
-
getValueX
public float getValueX()Returns the red value divided by 255- Specified by:
getValueX
in classParticleColor
- Returns:
- The offsetX value
-
getValueY
public float getValueY()Returns the green value divided by 255- Specified by:
getValueY
in classParticleColor
- Returns:
- The offsetY value
-
getValueZ
public float getValueZ()Returns the blue value divided by 255- Specified by:
getValueZ
in classParticleColor
- Returns:
- The offsetZ value
-
equals
public boolean equals(java.lang.Object other)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
toSpigot
public org.bukkit.Color toSpigot()
-