Closed W-Livi closed 7 years ago
And those who set their mod's color on the 0-1 range are screwed...
The documentation clearly illustrates usage of a 0-255 range. This change merely brings functionality in line with the documentation.
Oh... The documentation is bugged? Then fix the documentation! (Yes, I'm not pleased at all to be forced to update my 26 colored mods. My documentation is written in Lua and is always correct.)
I will also note that, according to the scripts package I had pulled down a while back, Overkill's own color definitions are also defined in terms 0-255 before being divided down to 0-1. So altering the code to match the docs brings us closer to the approach of the original devs.
In my opinion it should stay 0-1 since it's how overkill uses it. and yes do a search on all of the scripts of the game you'll see that 0-1 is much more used.
Actually, why not supporting both ways?
if self.color[1] > 1 or self.color[2] > 1 or self.color[3] > 1 then
self.color = Color(unpack(self.color)) / 255
else
self.color = Color(unpack(self.color))
end
Guess that's it ¯_(ツ)_/¯
Supporting both 0-1 and 0-255 is trivial (8e9ddf4), documentation states 0-255 because thats easier to get values since you can just pull them from Photoshop or whatever.
[0, 255] RGB color values from mod.txt now properly translated to expected [0, 1] ARGB.