暂无描述

hex2rgba.py 373B

1234567891011121314
  1. import struct
  2. with open("pkmn_sots.dmp", "rb") as f:
  3. output = ""
  4. while True:
  5. s = f.read(2)
  6. if not s:
  7. break
  8. col = struct.unpack("<H", s)[0]
  9. r = col & 0x1F
  10. g = (col >> 5) & 0x1F
  11. b = (col >> 10) & 0x1F
  12. output = output + "rgb82rgb5(0x{:02x},0x{:02x},0x{:02x}), ".format(r*8,g*8,b*8)
  13. print(output)