Class RainbowEffect

java.lang.Object
com.github.tommyettinger.textra.Effect
com.github.tommyettinger.textra.effects.RainbowEffect

public class RainbowEffect extends Effect
Tints the text in a rainbow pattern.
Parameters: distance;frequency;saturation;lightness
The distance rarely needs to be changed from 1, but it affects how much the position of the mouse in the affected text changes the effect. The frequency makes the effect faster when higher than 1, or slower when lower than 1; defaults to 1.0 . The saturation affects the rainbow's "colorful-ness", with 1 making it maximally colorful and 0 making it grayscale; defaults to 1.0 . The lightness affects how light the rainbow will be, with 0.5 the default, 1 being all white, and 0 being all black. Colors can appear the most saturated when lightness is 0.5.
Example usage: {RAINBOW=1;1;1;0.5}This span of text will use a vividly-saturated rainbow.{ENDRAINBOW} {RAINBOW=1;0.4;0.6;0.7}This span of text will use a slower-changing pastel rainbow.{ENDRAINBOW}
  • Constructor Details

  • Method Details

    • onApply

      protected void onApply(long glyph, int localIndex, int globalIndex, float delta)
      Description copied from class: Effect
      Called when this effect should be applied to the given glyph.
      Specified by:
      onApply in class Effect