Class RandomHueGenerator

java.lang.Object
imagingbook.common.color.iterate.RandomHueGenerator
All Implemented Interfaces:
ColorSequencer, Iterator<Color>

public class RandomHueGenerator extends Object implements ColorSequencer
Instances of this class create a sequence of random colors which only differ in hue, with saturation and value fixed.
Version:
2022/11/06
  • Constructor Details

    • RandomHueGenerator

      Constructor (no random seed).
    • RandomHueGenerator

      public RandomHueGenerator(long seed)
      Constructor with specific random seed (for repeatability).
      Parameters:
      seed - random seed
  • Method Details

    • setSaturation

      public void setSaturation(double s)
      Set the 'saturation' component of subsequent colors.
      Parameters:
      s - new saturation value
    • setBrightness

      public void setBrightness(double b)
      Set the 'brightness' component of subsequent colors.
      Parameters:
      b - new saturation value
    • next

      public Color next()
      Returns the next random color.
      Specified by:
      next in interface Iterator<Color>