nesdev.com
http://forums.nesdev.com/

Possible alternate colorspaces for video game palettes.
http://forums.nesdev.com/viewtopic.php?f=21&t=13886
Page 3 of 3

Author:  JRoatch [ Sun Mar 27, 2016 9:55 am ]
Post subject:  Re: Possible alternate colorspaces for video game palettes.

Ahh sorry lidnariq, my mistake. I was implying 4 bit values and results with those modular additions, and I see that I accidentally swapped my red and blue in that pseudocode.

A small python 3 program that correctly generates it as a GIMP Palette is:
Code:
print("""GIMP Palette
Name: RGBI Arranged.
Columns: 16
#""")
for i in range(256):
    print(((((i>>4)&0xc)+i)&0xf)*17, (i&0xf)*17, ((((i>>2)&0xc)+i)&0xf)*17)

Page 3 of 3 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/