Skip to content

fillGradient

fun GuiGraphics.fillGradient(
    x: Int, 
    y: Int, 
    width: Int, 
    height: Int, 
    topLeftColor: Int, 
    topRightColor: Int, 
    bottomLeftColor: Int, 
    bottomRightColor: Int
)

Fills a rectangle with a 4-corner color gradient using the default GUI RenderType.

fun GuiGraphics.fillGradient(
    type: RenderType, 
    x: Int, 
    y: Int, 
    width: Int, 
    height: Int, 
    topLeftColor: Int, 
    topRightColor: Int, 
    bottomLeftColor: Int, 
    bottomRightColor: Int
)

Fills a rectangle with a 4-corner color gradient, unlike vanilla's GuiGraphics.fillGradient (top-to-bottom only), by directly emitting one quad with a per-vertex ARGB color to type.