wolfboyft

Generate Colours

Sep 6th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. values = [0x0, 0x8, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38, 0x40, 0x48, 0x50, 0x58, 0x60, 0x68, 0x70, 0x78, 0x87, 0x8f, 0x97, 0x9f, 0xa7, 0xaf, 0xb7, 0xbf, 0xc7, 0xcf, 0xd7, 0xdf, 0xe7, 0xef, 0xf7, 0xff]
  2.  
  3. for x in range(0, 256):
  4.     print(hex(x), hex(min(values, key=lambda y:abs(y-x)) >> 3), hex(min(values, key=lambda y:abs(y-x))))
Add Comment
Please, Sign In to add comment