/** * Multiply all components with the given factor. * * @param color the color used as base colors * @param factor factor to multiply * @deprecated Typo in function name. Use {@link #multiply(Color, float)} * TODO: Remove in Nifty 2.0 */ @Deprecated public void mutiply(@Nonnull final Color color, final float factor) { multiply(color, factor); }
@Override public void execute( @Nonnull final Element element, final float normalizedTime, @Nullable final Falloff falloff, @Nonnull final NiftyRenderEngine r) { currentColor.linear(startColor, endColor, normalizedTime); if (falloff == null) { setColor(r, currentColor); } else { tempColor.multiply(currentColor, falloff.getFalloffValue()); setColor(r, tempColor); } }
@Override public void execute( @Nonnull final Element element, final float normalizedTime, @Nullable final Falloff falloff, @Nonnull final NiftyRenderEngine r) { r.saveStates(); currentColor.linear(startColor, endColor, normalizedTime); if (falloff == null) { r.setColor(currentColor); } else { tempColor.multiply(currentColor, falloff.getFalloffValue()); r.setColor(tempColor); } int size = width.getValueAsInt(element.getParent().getWidth()); if (size == -1) { r.renderQuad(element.getX(), element.getY(), element.getWidth(), element.getHeight()); } else { r.renderQuad((element.getX() + element.getWidth() / 2) - size / 2, element.getY(), size, element.getHeight()); } r.restoreStates(); }