Check out example codes for "pygame draw transparent rectangle". It will help you in understanding the concepts better.

Code Example 1

s = pygame.Surface((1000,750))  # the size of your rect
s.set_alpha(128)                # alpha level
s.fill((255,255,255))           # this fills the entire surface
windowSurface.blit(s, (0,0))    # (0,0) are the top-left coordinates

Learn ReactJs, React Native from akashmittal.com