A PDF shading by itself creates a shading of opaque colors.
If you want a shading in transparency, you can create a mask; in the mask template you use a shading, e.g. from white to black. In its use as mask this creates the effect of a shading opaque to transparent. With the mask active you then draw a gray rectangle. The effect is a shading from opaque gray to transparent gray.
Using iText I showed something similar in this answer. The image there

is a radial shading opaque red to somewhat transparent red and has been created by this code:
@Test
public void testComplex() throws FileNotFoundException, DocumentException
{
Document document = new Document();
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("target/test-outputs/transparencyComplex.pdf"));
writer.setCompressionLevel(0);
document.open();
PdfContentByte content = writer.getDirectContent();
content.setRGBColorStroke(0, 255, 0);
for (int y = 0; y <= 400; y+= 10)
{
content.moveTo(0, y);
content.lineTo(500, y);
}
for (int x = 0; x <= 500; x+= 10)
{
content.moveTo(x, 0);
content.lineTo(x, 400);
}
content.stroke();
PdfTemplate template = content.createTemplate(500, 400);
PdfTransparencyGroup group = new PdfTransparencyGroup();
group.put(PdfName.CS, PdfName.DEVICEGRAY);
group.setIsolated(false);
group.setKnockout(false);
template.setGroup(group);
PdfShading radial = PdfShading.simpleRadial(writer, 262, 186, 10, 262, 186, 190, BaseColor.WHITE, BaseColor.BLACK, true, true);
template.paintShading(radial);
PdfDictionary mask = new PdfDictionary();
mask.put(PdfName.TYPE, PdfName.MASK);
mask.put(PdfName.S, new PdfName("Luminosity"));
mask.put(new PdfName("G"), template.getIndirectReference());
content.saveState();
PdfGState state = new PdfGState();
state.put(PdfName.SMASK, mask);
content.setGState(state);
content.setRGBColorFill(255, 0, 0);
content.moveTo(162, 86);
content.lineTo(162, 286);
content.lineTo(362, 286);
content.lineTo(362, 86);
content.closePath();
content.fill();
content.restoreState();
document.close();
}
(TestTransparency.java)
Your shading should be implemented in a similar manner.