Class GradientEffect

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

public class GradientEffect extends Effect
Tints the text in a gradient pattern; never ends.
Parameters: color1;color2;distance;frequency
The color1 can be a named color or hex color; defaults to #FFFFFFFF (white). The color2 should be a named color or hex color; defaults to #888888FF (medium gray). The distance rarely needs to be changed from 1, but it affects how much the position of the glyph in the affected text changes the effect. The frequency affects how fast the effect should change; defaults to 1.0 .
Example usage: {GRADIENT=RED;LIGHT BLUE;1.0;0.3}This text will blend slowly between from red to light blue.{ENDGRADIENT} {GRADIENT=#111111FF;#EEEEEEFF;1.0;3.0}This text will blend quickly between from dark gray and light gray.{ENDGRADIENT}
  • 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