Introduction
Compare a solid fill, a two-color gradient and an outer shadow in one presentation using Aspose.Slides FOSS for Java. The three shapes share the same size and base color, making the effect of each setting visible.

Download the complete example · Open the comparison deck
This Java 26.7.0 example sets the paragraph’s default font size. PowerPoint applies that setting to unformatted portions in the paragraph. Direct portion font settings in newly created text were ignored by PowerPoint 16.0, build 12527, with this release; the paragraph-default setting used here is visible in the saved result.
Quick Start
Tested 8 November 2026: Windows x64, Eclipse Temurin JDK 21.0.10, and Aspose.Slides FOSS for Java 26.7.0 from Maven Central. The published JAR requires Java 21.
Extract the example into an empty directory. Use JDK 21. Download the 26.7.0 JAR from Maven Central into the extracted folder. These commands use the Windows classpath separator:
javac -cp aspose-slides-foss-26.7.0.jar Example.java
java -cp ".;aspose-slides-foss-26.7.0.jar" Example
Build the comparison
Save this complete program as Example.java. The project download includes the complete Example.java source.
import org.aspose.slides.foss.*;
import org.aspose.slides.foss.drawing.Color;
import org.aspose.slides.foss.export.SaveFormat;
public class Example {
public static void main(String[] args) throws java.io.IOException {
String[] labels = {"Solid", "Gradient", "Outer shadow"};
try (Presentation presentation = new Presentation()) {
for (int index = 0; index < labels.length; index++) {
String label = labels[index];
var shape = presentation.getSlides().get(0).getShapes().addAutoShape(ShapeType.RECTANGLE, 30 + index * 230, 160, 200, 180);
shape.setName(label);
shape.getTextFrame().setText(label);
shape.getTextFrame().getParagraphs().get(0).getParagraphFormat().getDefaultPortionFormat().setFontHeight(22);
shape.getFillFormat().setFillType(FillType.SOLID);
shape.getFillFormat().getSolidFillColor().setColor(new Color(22, 78, 99));
if (label.equals("Gradient")) {
shape.getFillFormat().setFillType(FillType.GRADIENT);
var gradient = shape.getFillFormat().getGradientFormat();
gradient.setGradientShape(GradientShape.LINEAR);
gradient.setLinearGradientAngle(90);
gradient.getGradientStops().add(0f, new Color(22, 78, 99));
gradient.getGradientStops().add(1f, new Color(15, 118, 110));
} else if (label.equals("Outer shadow")) {
shape.getEffectFormat().enableOuterShadowEffect();
var shadow = shape.getEffectFormat().getOuterShadowEffect();
shadow.setBlurRadius(6);
shadow.setDistance(6);
shadow.setDirection(45);
shadow.getShadowColor().setColor(Color.fromArgb(100, 0, 0, 0));
}
}
presentation.save("effects-comparison.pptx", SaveFormat.PPTX);
}
System.out.println("Created effects-comparison.pptx");
}
}
Read the three results
The solid shape uses RGB color #164E63. It gives a baseline for the other two shapes and a consistent background behind the label.
The gradient runs from #164E63 to #0F766E. Its stop positions are 0 and 1, the beginning and end of the fill. The 90-degree linear angle produces the top-to-bottom transition shown in the screenshot. Use a modest difference between colors when text must remain readable across the entire shape.
The outer shadow keeps the solid fill and adds a six-point blur and six-point distance at 45 degrees. The shadow color uses alpha 100 on the 0–255 scale, making it partly transparent. The saved shape contains those parameters, and the shadow is visible below and to the right in PowerPoint.
Limits and troubleshooting
The screenshot was exported from this generated file with Microsoft PowerPoint 16.0, build 12527. Viewer rendering can differ, particularly for transparency and effects. Inspect the output in the application your recipients use.
If the gradient appears unchanged, confirm you selected gradient fill before adding stops. If the shadow is absent, confirm the effect was enabled before setting its properties. For a darker or lighter result, change the color or alpha explicitly; changing a text color does not change the shape fill.
This comparison covers these three settings. It does not promise that every glow, bevel, material or camera combination behaves identically. Start with one effect at a time when adapting the example.