codehaus


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Color representation as rgb, int and hex


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