Merge branch 'fix-gamma' of juergen/pixelserver2 into master

This commit is contained in:
Sven Tysk 2018-12-28 15:06:55 +00:00 committed by Gogs
commit fa2773b76a

View File

@ -106,12 +106,9 @@ class SerialWriter(threading.Thread):
gr = int(math.pow(i/255, r)*255)
gg = int(math.pow(i/255, g)*255)
gb = int(math.pow(i/255, b)*255)
assert gr >= 0 and gr <= 255
assert gg >= 0 and gg <= 255
assert gb >= 0 and gb <= 255
buf[i] =gr
buf[i+255] = gg
buf[i+511] = gb
buf[i] = max(0, min(255, gr))
buf[i+256] = max(0, min(255, gg))
buf[i+512] = max(0, min(255, gb))
ser.write(b"\x02")
ser.write(buf)
self.updateGamma = False