Class HighlightEffect
java.lang.Object
com.github.tommyettinger.textra.Effect
com.github.tommyettinger.textra.effects.HighlightEffect
Tints the single glyph (or affected text, if all is true) underneath the pointer/mouse in a rainbow pattern.
Parameters:
The
Example usage:
Parameters:
color;distance;frequency;saturation;lightness;all
The
color
can be any named color, potentially with modifiers, or a hex color (optionally starting with #), or
"default" to use the existing default color of the label.
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.
The saturation
affects the rainbow's "colorful-ness", with 1 making it maximally colorful and 0 making it
grayscale.
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.
The parameter all
makes the whole span of text become affected when true, or individual glyphs be the only
things affected when false.
Example usage:
{HIGHLIGHT=default;1;1;1;0.5;true}This whole span of text will be highlighted vividly on mouse-over.{ENDHIGHLIGHT}
{HIGHLIGHT=default;1;0.4;0.6;0.7;false}Individual glyphs will be highlighted slowly in pastel colors on mouse-over.{ENDHIGHLIGHT}
-
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