code: private String svgColorStr() {
          String result = "black;";
          if (this.paint instanceof Color) {
              return rgbColorStr((Color) this.paint);
          } else if (this.paint instanceof GradientPaint 
                  || this.paint instanceof LinearGradientPaint
                  || this.paint instanceof RadialGradientPaint) {
              return "url(#" + this.gradientPaintRef + ")";
          }
          return result;
      }
docs: Returns an SVG color string based on the current paint.  To handle
  {@code GradientPaint} we rely on the {@code setPaint()} method
  having set the {@code gradientPaintRef} attribute.
  
  @return An SVG color string.