Class RainbowEffect
java.lang.Object
com.github.tommyettinger.textra.Effect
com.github.tommyettinger.textra.effects.RainbowEffect
Tints the text in a rainbow pattern.
Parameters:
The
Example usage:
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}
-
Nested Class Summary
Nested classes/interfaces inherited from class com.github.tommyettinger.textra.Effect
Effect.EffectBuilder
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
onApply
(long glyph, int localIndex, int globalIndex, float delta) Called when this effect should be applied to the given glyph.Methods inherited from class com.github.tommyettinger.textra.Effect
apply, assignTokenName, calculateFadeout, calculateProgress, calculateProgress, calculateProgress, isFinished, paramAsBoolean, paramAsColor, paramAsFloat, update