Skip to content
Advertisement

How can I add a colour gradient feature to my bresenham line drawing algorithm?

I’ve found this thread on StackOverflow but my python understanding isn’t that good to properly translate it to C, I’m trying to add that gradient feature to this line drawing algorithm:

JavaScript

I feel bad for asking such a trivial task but I really can’t understand what is going on on the python side nor how the colours are represented (mine are int(0xttrrggbb))

Advertisement

Answer

Figured it out:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement