in python I am trying to create a picture with 20 by 20 pixels. Then define a function to add a black 16 by 16 oval at position (0, 0). But I am doing something wrong which I can’t put my finger on. Please help. Thanks.
import media
pic=media.create_picture(20,20)
def copy_right(pic):
media.add_oval_filled(pic,0,0,16,16,"black")
return media.show(pic)
copy_right(pic)
The traceback (which should be put in a listing block in the question) shows a type error, where PyGraphics expects something with a
get_rgb()method, but got a string. You need to replace “black” in your code with a Color object from PyGraphics.