Answer the question
In order to leave comments, you need to log in
Can you please explain how this algorithm works?
I needed an algorithm capable of filling with a gradient of any color and any scale.
I found it, but when I try to understand the principle of its operation, I get a mess in my head, even if the algorithm looks very simple.
Here is the code - https://pastebin.com/pdQfV1zZ
Answer the question
In order to leave comments, you need to log in
I would start by listing the help() documentation for each of the functions used:
Surface((width, height), flags=0, depth=0, masks=None) -> Surface
Surface((width, height), flags=0, Surface) -> Surface
pygame object for representing images
line(surface, color, start_pos, end_pos) -> Rect
line(surface, color, start_pos, end_pos, width=1) -> Rect
draw a straight line
smoothscale(surface, size, dest_surface=None) -> Surface
scale a surface to an arbitrary size smoothly
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question