I get a an error message.
It reacts to " for p in FGradients do " ??
I use the new 'for x in y' syntax that was introduced in a recent version of FPC (see my sig).
If you use an older version you'll have to iterate through the list via an integer:
var i: integer;
gi: TGradientInfo;
//...
for i := 0 to FGradients.Count-1 do
begin
gi := FGradients(i) as TGradientInfo;
// do processing...
Note the brackets in 'FGradients(i)' are square brackets, but I don't know how to post them.
EDIT: but Gradient Filler has a flickering bug
Not really: the idea is that GradientFiller paints a gradient on a canvas be it a Form.Canvas or a Bitmap.Canvas.
If used directly on a visible canvas it might flicker, as does all painting on a visible Canvas.
FWIW: if I set DoubleBuffered to true on my own forms, the flicker is gone.
Having said that: it's very easy to exend the functionality of TGradientFiller to store a local copy of the gradient and use that in the Draw method.
And only regenerate when any of the properties change...