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 Nov 16, 2026
·
3 revisions
Generate image: linear gradient. direction is in degrees: 0 is vertical (from top to bottom), 90 is horizontal (from left to right); the gradient 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