Random Rectangle Color Generator

  • Share this:

Code introduction


This function generates a random color and uses the draw_rectangle_filled function from the Arcade library to draw a rectangle filled with this random color.


Technology Stack : Arcade library

Code Type : Function

Code Difficulty : Intermediate


                
                    
def random_circle_color():
    import random
    from arcade import Color, draw_rectangle_filled

    # Generate a random color
    random_color = Color(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))

    # Draw a rectangle filled with the random color
    draw_rectangle_filled(100, 100, 100, 100, random_color)                
              
Tags: