set

operator fun set(x: Int, y: Int, color: Color)(source)

Sets the pixel at column x and row y, counted from the top-left corner, to color.

Throws

if x is outside 0 until width or y is outside 0 until height.

Samples

val image = Image(4, 4)
assertPrints(image[1, 2], "Color(#00000000)")
image[1, 2] = Color(red = 1f, green = 0f, blue = 0f)
assertPrints(image[1, 2], "Color(#ff0000ff)")