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 format
    int getGreen()
    Returns the green value of the RGB format
    int getRed()
    Returns the red value of the RGB format
    float getValueX()
    Returns the red value divided by 255
    float getValueY()
    Returns the green value divided by 255
    float getValueZ()
    Returns the blue value divided by 255
    int hashCode()  
    org.bukkit.Color toSpigot()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • OrdinaryColor

      public OrdinaryColor​(int red, int green, int blue) throws java.lang.IllegalArgumentException
      Construct a new ordinary color
      Parameters:
      red - Red value of the RGB format
      green - Green value of the RGB format
      blue - 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 class ParticleColor
      Returns:
      The offsetX value
    • getValueY

      public float getValueY()
      Returns the green value divided by 255
      Specified by:
      getValueY in class ParticleColor
      Returns:
      The offsetY value
    • getValueZ

      public float getValueZ()
      Returns the blue value divided by 255
      Specified by:
      getValueZ in class ParticleColor
      Returns:
      The offsetZ value
    • equals

      public boolean equals​(java.lang.Object other)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • toSpigot

      public org.bukkit.Color toSpigot()