You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JoeStrout edited this page Apr 29, 2026
·
2 revisions
Generate image: linear gradient The direction value specifies the direction of the gradient (in degrees) with 0 being vertical (from top to bottom), 90 being horizontal (from left to right) The gradient effectively rotates counter-clockwise by the specified amount
Parameters
Parameter
Default Value
Note
width
256
height
256
direction
0
start
BLACK
end
WHITE
Return value
Condition
Return Value
(always)
map
Notes
Example
// Vertical gradient from black (top) to white (bottom)img=raylib.GenImageGradientLinear(128, 128, 0, raylib.BLACK, raylib.WHITE)
tex=raylib.LoadTextureFromImage(img)
raylib.UnloadImageimgraylib.BeginDrawingraylib.ClearBackgroundraylib.BLACKraylib.DrawTexturetex, 0, 0, raylib.WHITEraylib.EndDrawingraylib.UnloadTexturetex