get

operator fun get(x: Int, y: Int): Color(source)

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

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)")