<commit_before>package de.lessvoid.nifty.effects.impl;


import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.effects.EffectImpl;
import de.lessvoid.nifty.effects.EffectProperties;
import de.lessvoid.nifty.effects.Falloff;
import de.lessvoid.nifty.elements.Element;
import de.lessvoid.nifty.render.NiftyRenderEngine;
import de.lessvoid.nifty.tools.Color;

/**
 * change textcolor on hover.
 * @author void
 */
public class TextColor implements EffectImpl {

  /**
   * textcolor.
   */
  private Color color;

  /**
   * initialize.
   * @param nifty Nifty
   * @param element Element
   * @param parameter Parameter
   */
  public void activate(final Nifty nifty, final Element element, final EffectProperties parameter) {
    color = new de.lessvoid.nifty.tools.Color(parameter.getProperty("color", "#ffffffff"));
  }

  /**
   * execute the effect.
   * @param element the Element
   * @param normalizedTime TimeInterpolator to use
   * @param normalizedFalloff falloff value
   * @param r RenderDevice to use
   */
  public void execute(
      final Element element,
      final float normalizedTime,
      final Falloff fFalloff,
      final NiftyRenderEngine r) {
    r.setColor(color);
  }

  /**
   * deactivate the effect.
   */
  public void deactivate() {
  }
}<commit_msg>@public #2903207: Effects on TextField The TextColor effect will now use the changed alpha value of the NiftyRenderEngine. This means that the TextColor effect can be affected by other effects that change the current alpha value.<commit_after>package de.lessvoid.nifty.effects.impl;


import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.effects.EffectImpl;
import de.lessvoid.nifty.effects.EffectProperties;
import de.lessvoid.nifty.effects.Falloff;
import de.lessvoid.nifty.elements.Element;
import de.lessvoid.nifty.render.NiftyRenderEngine;
import de.lessvoid.nifty.tools.Color;

/**
 * change textcolor on hover.
 * @author void
 */
public class TextColor implements EffectImpl {

  /**
   * textcolor.
   */
  private Color color;

  /**
   * initialize.
   * @param nifty Nifty
   * @param element Element
   * @param parameter Parameter
   */
  public void activate(final Nifty nifty, final Element element, final EffectProperties parameter) {
    color = new de.lessvoid.nifty.tools.Color(parameter.getProperty("color", "#ffffffff"));
  }

  /**
   * execute the effect.
   * @param element the Element
   * @param normalizedTime TimeInterpolator to use
   * @param normalizedFalloff falloff value
   * @param r RenderDevice to use
   */
  public void execute(
      final Element element,
      final float normalizedTime,
      final Falloff fFalloff,
      final NiftyRenderEngine r) {
    if (r.isColorAlphaChanged()) {
      r.setColorIgnoreAlpha(color);
    } else {
      r.setColor(color);
    }
  }

  /**
   * deactivate the effect.
   */
  public void deactivate() {
  }
}
{'fraction_non_alphanumeric': 0.09916782246879334, 'fraction_numerical': 0.0024271844660194173, 'mean_word_length': 3.4384615384615387, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3137679', 'n_tokens_mistral': 910, 'n_tokens_neox': 888, 'n_words': 237}