fillTriangle

fun fillTriangle(x1: Int, y1: Int, x2: Int, y2: Int, x3: Int, y3: Int, color: Color): Image

Draws a filled triangle on the image.

Return

A new Image object with the triangle drawn on the image

Parameters

x1

The X coordinate of the first vertex

y1

The Y coordinate of the first vertex

x2

The X coordinate of the second vertex

y2

The Y coordinate of the second vertex

x3

The X coordinate of the third vertex

y3

The Y coordinate of the third vertex

color

The color of the triangle


fun fillTriangle(x1: Int, y1: Int, x2: Int, y2: Int, x3: Int, y3: Int, color1: Color, color2: Color, color3: Color): Image

Draws a filled triangle on the image, linear interpolating three colors to the center.

Return

A new Image object with the triangle drawn on the image

Parameters

x1

The X coordinate of the first vertex

y1

The Y coordinate of the first vertex

x2

The X coordinate of the second vertex

y2

The Y coordinate of the second vertex

x3

The X coordinate of the third vertex

y3

The Y coordinate of the third vertex

color1

The color of the triangle at the first vertex

color2

The color of the triangle at the second vertex

color3

The color of the triangle at the third vertex