Class HighlightEffect

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

public class HighlightEffect extends Effect
Tints the single glyph (or affected text, if all is true) underneath the pointer/mouse in a rainbow pattern.
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}
  • 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