code: private Paint decodeCloseGradient(Shape s, Color top, Color bottom) {
          Rectangle r      = s.getBounds();
          int       width  = r.width;
          int       height = r.height;
  
          return createGradient(r.x + width / 2, r.y, r.x + width / 2, r.y + height - 1, new float[] { 0f, 1f }, new Color[] { top, bottom });
      }
docs: Create the gradient for the close button.
  
  @param  s      the shape to fill.
  @param  top    the top color.
  @param  bottom the bottom color.
  
  @return the gradient.