code: static IRenderingElement outerGlow(IRenderingElement element, Color color, double glowWidth, double stroke) {
          if (element instanceof ElementGroup) {
              ElementGroup orgGroup = (ElementGroup) element;
              ElementGroup newGroup = new ElementGroup();
              for (IRenderingElement child : orgGroup) {
                  newGroup.add(outerGlow(child, color, glowWidth, stroke));
              }
              return newGroup;
          } else if (element instanceof LineElement) {
              LineElement lineElement = (LineElement) element;
              return new LineElement(lineElement.firstPointX, lineElement.firstPointY, lineElement.secondPointX,
                      lineElement.secondPointY, stroke + (2 * (glowWidth * stroke)), color);
          } else if (element instanceof GeneralPath) {
              GeneralPath org = (GeneralPath) element;
              if (org.fill) {
                  return org.outline(2 * (glowWidth * stroke)).recolor(color);
              } else {
                  return org.outline(stroke + (2 * (glowWidth * stroke))).recolor(color);
              }
          }
          throw new IllegalArgumentException("Cannot generate glow for rendering element, " + element.getClass());
      }
docs: Generate an outer glow for the provided rendering element. The glow is defined by the glow
  width and the stroke size.
  
  @param element   rendering element
  @param color     color of the glow
  @param glowWidth the width of the glow
  @param stroke    the stroke width
  @return generated outer glow