Green to red color sweep
BlitzPlus Forums/BlitzPlus Programming/Green to red color sweep
| ||
Simple question, I need to make a health display that goes from green to red as your health goes down. How do I turn the raw maxhp and hp variables into RGB values? |
| ||
red = (1-hp/float(maxhp))*255 green = 255*hp/float(maxhp) Color red,green,0 (the float bit is to make sure the number doesn't get rounded down to 0 as an integer) |
| ||
Ahh, I see how that works. It gets the percent of HP left, then gets that percentage of 255, right? |
| ||
Yep |