The TCanvas.GradientFill is quite limited, compared to BGRABitmap or other high-end graphics libraries. It fills the specified rectangle from left to right (gdHorizontal) or from top to bottom (gdVertical) using only the two specified colors at the gradient start and end positions (left/right or top/bottom, respectively).
If you need a multi-color gradient you can split the rectangle into several parts and fill them by their own two-color gradients. The attached project, for example, draws a horizontal gradient between yellow and red over the left part of the PaintBox where the width of this part is defined by the relative position of the scrollbar, and a gradient from red to blue over the rest of the Paintbox.