Skip to content

drawRectGradient

Draws a filled rectangle with a gradient.

TIP

All drawing functions should be called within a render callback/loop.

Syntax

lua
Ham.drawRectGradient(rect, colorStart, colorEnd, vertical)

Parameters

NameTypeDescription
recttableRectangle {x, y, w, h}
colorStarttableStarting color {r, g, b, a}
colorEndtableEnding color {r, g, b, a}
verticalbooleantrue for vertical gradient, false for horizontal

Example

lua
Ham.drawRectGradient({0, 0, 200, 50}, {255, 0, 0, 255}, {0, 0, 255, 255}, false)

See Also

Released under the ISC License.