classSpriteSolidColor(Sprite):""" This sprite is just a rectangular sprite of one solid color. No need to use an image file. :param int width: Width of the sprite :param int height: Height of the sprite :param Color color: Color of the sprite """def__init__(self,width:int,height:int,color:Color):""" Create a solid-color rectangular sprite. """super().__init__()cache_name=_build_cache_name("Solid",width,height,color[0],color[1],color[2])# use existing texture if it existsifcache_nameinload_texture.texture_cache:# type: ignoretexture=load_texture.texture_cache[cache_name]# type: ignore# otherwise, generate a filler sprite and add it to the cacheelse:image=PIL.Image.new("RGBA",(width,height),color)texture=Texture(cache_name,image)load_texture.texture_cache[cache_name]=texture# type: ignore# apply chosen texture to the current spriteself.texture=textureself._points=texture.hit_box_points