JamesWilko / Payday-2-BLT-Lua

Mods folder that controls the ingame aspects of the Payday 2 BLT.
MIT License
16 stars 26 forks source link

Correcting mod manager color behavior #31

Closed W-Livi closed 7 years ago

W-Livi commented 7 years ago

[0, 255] RGB color values from mod.txt now properly translated to expected [0, 1] ARGB.

TdlQ commented 7 years ago

And those who set their mod's color on the 0-1 range are screwed...

W-Livi commented 7 years ago

The documentation clearly illustrates usage of a 0-255 range. This change merely brings functionality in line with the documentation.

TdlQ commented 7 years ago

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.)

W-Livi commented 7 years ago

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.

Luffyyy commented 7 years ago

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.

TdlQ commented 7 years ago

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
Luffyyy commented 7 years ago

Guess that's it ¯_(ツ)_/¯

JamesWilko commented 7 years ago

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.