Fill parameter (@param fill)
The fill parameter type makes the parameter dialog open a fill editor: solid, gradient (two colors + angle) or none — with a live preview. The script receives a ready-made FillSpec and applies it to a shape.
Syntax
// @param fill <name> "<Label>" [default="<fill>"] [tooltip="…"]
The three default formats:
| Fill kind | default | Meaning |
|---|---|---|
| Solid | solid:#0070C0 (or just #0070C0) |
one color |
| Gradient | gradient:#0070C0,#00B0F0,90 |
start color, end color, angle (°) |
| None | none |
no fill (transparent) |
In the script, Params.GetFill("<name>") returns a FillSpec with Kind (FillKind.Solid / Gradient / None), Color1, Color2, Angle, Transparency.
Apply
The helper ppptools.ApplyFill(shape, spec) branches internally by fill kind:
// @param fill Fuellung "Fill" default="gradient:#0070C0,#00B0F0,90" tooltip="Fill of the selected shapes"
// @button Apply
var f = Params.GetFill("Fuellung");
var sel = ppptools.GetSelectedRange();
for (int i = 1; i <= sel.Count; i++)
ppptools.ApplyFill(sel[i], f);
In the dialog a fill preview sits next to the "Bearbeiten…" button. The editor switches between solid (color + transparency), gradient (two colors + angle) and none.
Combined with a border
@param fill and @param line combine into a complete shape-style snippet:
// @param fill Fuellung "Fill" default="solid:#0070C0"
// @param line Rahmen "Border" default="#003A66,1.5,solid"
// @button Apply style
var f = Params.GetFill("Fuellung");
var b = Params.GetLine("Rahmen");
var sel = ppptools.GetSelectedRange();
for (int i = 1; i <= sel.Count; i++)
{
ppptools.ApplyFill(sel[i], f);
ppptools.SetLine(sel[i], b);
}
Gradient & transparency
The gradient uses SetGradient internally (two stops, adjustable angle). Transparency (solid only) ranges from 0 % (opaque) to 100 % (invisible).