You can download this code by clicking the button below.
This code is now available for download.
This function uses the Arcade library to draw a rectangle with a random color.
Technology Stack : Arcade
Code Type : Function
Code Difficulty : Intermediate
import arcade
import random
def random_color_rectangle(x, y, width, height):
# Generate a random color
color = (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
# Draw a rectangle with the random color
arcade.draw_rectangle_filled(x, y, width, height, color)
# Code Information