Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function getColor(number,x_middle,x_max)
- local color
- if number<=x_middle then
- local value = math.floor(0xFF*(number/x_middle))
- color = 0xFF0000 + value*0x101
- else
- local value = math.floor(0xFF*(1-(number-x_middle)/(x_max-x_middle)))
- color = 0x00FF00 + value*0x10001
- end
- return color+0xFF000000
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement