Gambas Documentation - /comp/gb.image.effect/image/gradient

# Image.Gradient (gb.image.effect)

Static Function Gradient ( Width As Integer, Height As Integer, SrcColor As Integer, DstColor As Integer, Orientation As Integer [ , XDecay As Float, YDecay As Float ] ) As Image

Create a gradient image.

- Width is the width of the result image.

- Height is the height of the result image.

- SrcColor is the starting color.

- DstColor is the ending color.

- Orientation is the gradient orientation.

- XDecay is the x decay length between `-1` and `1`.

- YDecay is the y decay length between `-1` and `1`.

Orientation can be one of the following values:

- Image.Vertical for a vertical gradient.

- Image.Horizontal for an horizontal gradient.

- Image.Diagonal for a diagonal gradient.

- Image.Cross for a cross diagonal gradient.

- Image.Pyramid for a pyramidal gradient.

- Image.Rectangle for a rectangular gradient.

- Image.PipeCross for a pipe cross gradient.

- Image.Elliptic for an elliptic gradient.

The generated gradient is linear, unless XDecay or YDecay are specified. In that case the gradient is exponential.