[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Gradient Algorithm



Patrick Mullen wrote:
Could you modify it so that it can handle horizontal or diagonal gradients as well? Horizontal is easy, I'm not sure about diagonals though. I guess you would have to increment y and x by their own separate speed for each iteration and then draw a line from 0,y to x,0. But that only works for top-left to bottom-right diagonals. I guess it needs a special case for all 4 diagonals, and horizontal, and vertical :)

Yes, I could. 8)

It sounds like I should rework my interface code anyway, so in the process maybe I'll add horizontal gradients. They should be easy to add. Diagonal sounds too awkward for me, though.

Kris
Inspired by the classic SquareSoft blue gradient.