public class RegularColor extends ParticleColor
ParticleColor class that supports normal RGB values.
If you want to define a custom size for ParticleEffect.REDSTONE or the second
color for ParticleEffect.DUST_COLOR_TRANSITION, use DustData and
DustColorTransitionData. You can however use this class if you're just looking
to set the color.
PropertyType.COLORABLE| Constructor and Description |
|---|
RegularColor(Color color)
Initializes a new
ParticleData object. |
RegularColor(int red,
int green,
int blue)
Initializes a new
ParticleData object. |
| Modifier and Type | Method and Description |
|---|---|
static RegularColor |
fromHSVHue(int hue)
Constructs a
RegularColor using the HSV color spectrum. |
float |
getBlue()
Gets the blue value of the color.
|
float |
getGreen()
Gets green red value of the color.
|
float |
getRed()
Gets the red value of the color.
|
static RegularColor |
random()
Generates a random
RegularColor instance with a high saturation. |
static RegularColor |
random(boolean highSaturation)
Generates a random
RegularColor instance. |
Object |
toNMSData()
Converts the current
ParticleData instance into nms data. |
getEffect, setEffectpublic RegularColor(Color color)
ParticleData object.color - the Color the
particle should have.public RegularColor(int red,
int green,
int blue)
ParticleData object.red - the red value of the color.green - the green value of the color.blue - the blue value of the color.public float getRed()
getRed in class ParticleColorpublic float getGreen()
getGreen in class ParticleColorpublic float getBlue()
getBlue in class ParticleColorpublic Object toNMSData()
ParticleData instance into nms data. If the current
minecraft version was released before 1.13 an int array should be returned. If the
version was released after 1.12 a nms "ParticleParam" has to be returned.
This method also supports TransitioningDust particles since 1.6.
toNMSData in class ParticleColorpublic static RegularColor random()
RegularColor instance with a high saturation. If you
want a completely random Color use random(boolean) with false
as the highSaturarion parameter.RegularColor instance.public static RegularColor random(boolean highSaturation)
RegularColor instance. If the highSaturation parameter
is set to true, a random hue from the HSV spectrum will be used. Otherwise, 3 random
integers ranging from 0 to 255 for the RGB values will be generated.highSaturation - determines if the colors should have a high saturation.RegularColor instance.public static RegularColor fromHSVHue(int hue)
RegularColor using the HSV color spectrum.hue - the hue the specific color has.RegularColor instance with the given HSV value as its Color.Color.HSBtoRGB(float, float, float)Copyright © 2021. All rights reserved.