code: public void setForegroundIcon(final PROVIDER iconProvider, final Color color) {
          // copy old images to replace later.
          final Shape oldForegroundIcon = foregroundIcon;
          final Shape oldForegroundFadeIcon = foregroundFadeIcon;
  
          // create new images.
          this.foregroundIcon = createIcon(iconProvider, Layer.FOREGROUND);
          this.foregroundFadeIcon = createColorFadeIcon(iconProvider, Layer.FOREGROUND);
  
          // setup icon color
          if (color != null) {
              setForegroundIconColor(color);
          }
  
          // replace old icons with new ones.
          getChildren().replaceAll((node) -> {
              if (node.equals(oldForegroundIcon)) {
                  return foregroundIcon;
              } else if (node.equals(oldForegroundFadeIcon)) {
                  return foregroundFadeIcon;
              } else {
                  return node;
              }
          }
docs: Changes the foregroundIcon icon.
  <p>
  Note: previous color setup and animations are reset as well.
  
  @param iconProvider the icon which should be set as the new icon.
  @param color        the color of the new icon.