Color representation as rgb, int and hex

Eko palypse ekopalypse at gmail.com
Sun Sep 8 15:58:28 EDT 2019


I'm confused about the following

import sys
print(tuple(bytes.fromhex('282C34')))
print(tuple((0x282C34).to_bytes(3, byteorder=sys.byteorder)))

which results in 

(40, 44, 52)
(52, 44, 40)

on my machine. Shouldn't I expect the same result?

Thank you
Eren



More information about the Python-list mailing list