mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-17 09:06:06 +09:00
corrected candlelight colour (using Yxy instead of Lab)
Former-commit-id: 7d784a840c2339a49f1dfc5a739bf8ce306ec2e4 Former-commit-id: d3b18605dd51ceb779841835c88802b8cf3afaa4
This commit is contained in:
21
work_files/Tools/8bcolto10bcol.py
Normal file
21
work_files/Tools/8bcolto10bcol.py
Normal file
@@ -0,0 +1,21 @@
|
||||
def rawTo10bit(bit):
|
||||
b = (bit & 0xff)
|
||||
g = (bit & 0xff00) >> 8
|
||||
r = (bit & 0xff0000) >> 16
|
||||
return to10bit(r, g, b)
|
||||
|
||||
def to10bit(r, g, b):
|
||||
return (r << 20 | g << 10 | b)
|
||||
|
||||
|
||||
def from10bit(tenbit):
|
||||
r = (tenbit >> 20) & 0xff
|
||||
g = (tenbit >> 10) & 0xff
|
||||
b = tenbit & 0xff
|
||||
return (r, g, b)
|
||||
|
||||
def to8bit(r, g, b):
|
||||
return (b << 16 | g << 8 | r)
|
||||
|
||||
print to10bit(255, 163, 0)
|
||||
print from10bit(226629701)
|
||||
Reference in New Issue
Block a user