You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi so this is something unrelated to my pull request that i found, light bg does NOT use the hsv v value to interpolate but it actually uses the sum of the r, g and b. i did find this in 1.9's code but 2.1 seems to behave identically from my testing.
almost-python pseudocode below for how it actually works, assuming rgb values are 0-255 and hsv's sv values are 0-100:
deflightBG(background: RGB, player1: RGB):
hsv=background.toHSV()
hsv.s-=20# pretend this is clamped between 0 and 100hsv.v+=20# this toolightBG=hsv.toRGB()
f= (background.r+background.g+background.b) /150iff<1:
lightBG.r=lightBG.r*f+player1.r* (1-f)
lightBG.g=lightBG.g*f+player1.g* (1-f)
lightBG.b=lightBG.b*f+player1.b* (1-f)
returnrgb
i found the hsv offsets in 1.9's PlayLayer::getLightBGColor and the actual interpolation was done in PlayLayer::updateVisibility, no idea if they're in the same functions in 2.1 though
The text was updated successfully, but these errors were encountered:
hi so this is something unrelated to my pull request that i found, light bg does NOT use the hsv v value to interpolate but it actually uses the sum of the r, g and b. i did find this in 1.9's code but 2.1 seems to behave identically from my testing.
almost-python pseudocode below for how it actually works, assuming rgb values are
0
-255
and hsv's sv values are0
-100
:i found the hsv offsets in 1.9's
PlayLayer::getLightBGColor
and the actual interpolation was done inPlayLayer::updateVisibility
, no idea if they're in the same functions in 2.1 thoughThe text was updated successfully, but these errors were encountered: