Skip to content

raylib.ImageDrawRectangleGradientEx

JoeStrout edited this page Oct 17, 2026 · 1 revision

Draw rectangle with gradient colors within an image, counter-clockwise color order

Parameters

Parameter Default Value Note
dst
rec
col1
col2
col3
col4

Return value

None.

Notes

Colors are for the corners in counter-clockwise order, starting at the top-left: top-left, bottom-left, bottom-right, top-right.

Example

img = raylib.GenImageColor(128, 128, raylib.BLACK)
raylib.ImageDrawRectangleGradientEx img, [0, 0, 128, 128], raylib.RED, raylib.GREEN, raylib.BLUE, raylib.WHITE
raylib.ExportImage img, "gradient.png"
raylib.UnloadImage img

Clone this wiki locally