public class RandomColor
extends java.lang.Object
Constructor and Description |
---|
RandomColor()
Creates a color randomizer with the color black, a default
Random object and a randomizer magnitude of 150. |
RandomColor(java.awt.Color pColor)
Creates a color randomizer with the specified, a default
Random object and a randomizer magnitude of 150. |
RandomColor(java.awt.Color pColor,
java.util.Random pRandom)
Creates a color randomizer with the specified, the specified
Random object and a randomizer magnitude of 150. |
RandomColor(java.awt.Color pColor,
java.util.Random pRandom,
double dMagnitude)
Creates a color randomizer with the specified, the specified
Random object and the specified randomizer magnitude. |
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getNextColorHSB(boolean bRandomizeHue,
boolean bRandomizeSaturation,
boolean bRandomizeBrightness)
Calculates a new random color by modifying the specified HSB parameters of the base color of this object.
|
java.awt.Color |
getNextColorRGB(boolean bRandomizeRed,
boolean bRandomizeGreen,
boolean bRandomizeBlue)
Calculates a new random color by modifying the specified RGB channels of the base color of this object.
|
void |
setColor(java.awt.Color pColor)
Sets the color that should be the starting point for the randomizer process.
|
void |
setRandom(java.util.Random pRandom)
Sets the
Random object that should be used to generate the random numbers for the color calculation. |
void |
setRandomMagnitude(double dMagnitude)
Sets the randomizer magnitude.
|
public RandomColor()
Random
object and a randomizer magnitude of 150.public RandomColor(java.awt.Color pColor)
Random
object and a randomizer magnitude of 150.pColor
- The color that should be used as base color for the randomize process.public RandomColor(java.awt.Color pColor, java.util.Random pRandom)
Random
object and a randomizer magnitude of 150.pColor
- The color that should be used as base color for the randomize process.pRandom
- The Random
object that should be used to generate the random numbers.public RandomColor(java.awt.Color pColor, java.util.Random pRandom, double dMagnitude)
Random
object and the specified randomizer magnitude.pColor
- The color that should be used as base color for the randomize process.pRandom
- The Random
object that should be used to generate the random numbers.dMagnitude
- The randomizer magnitude as double.public void setColor(java.awt.Color pColor)
pColor
- The color that should be used as base color for the randomize process.public void setRandom(java.util.Random pRandom)
Random
object that should be used to generate the random numbers for the color calculation.pRandom
- The Random
object that should be used to generate the random numbers.public void setRandomMagnitude(double dMagnitude)
dMagnitude
- The randomizer magnitude as double.public java.awt.Color getNextColorRGB(boolean bRandomizeRed, boolean bRandomizeGreen, boolean bRandomizeBlue)
bRandomizeRed
- A flag indicating if the red color channel should be modified.bRandomizeGreen
- A flag indicating if the green color channel should be modified.bRandomizeBlue
- A flag indicating if the blue color channel should be modified.public java.awt.Color getNextColorHSB(boolean bRandomizeHue, boolean bRandomizeSaturation, boolean bRandomizeBrightness)
bRandomizeHue
- A flag indicating if the hue should be modified.bRandomizeSaturation
- A flag indicating if the saturation should be modified.bRandomizeBrightness
- A flag indicating if the brightness should be modified.