Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def mouse_gradient(radius):
- mp = mouse_pos() # custom function, just wraps fetching mouse coords from sdl2
- mouse_grad = None
- mouse_grad = aggdraw.Draw('RGBA', (radius, radius), (0, 0, 0, 0))
- for n in range(radius):
- n = float(n)
- r = float(radius - n)
- opacity = int(( 0.25 * n / radius) * 100)
- brush = aggdraw.Brush((255, 0, 0), int(opacity))
- tl = (radius - r) // 2
- br = (radius - r) // 2 + r
- mouse_grad.ellipse((tl, tl, br, br), brush)
- return mouse_grad # where it is subsequently blit to the screen
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement