User | Post |
HyperLamer
Posts: 3945/8210 |
Heh, I thought I remembered something about having to use the higher bits of the colour, but I figured that was for converting to RGB. But then I never really worked with SNES either; Gameboy Colour just also happens to use 15-bit RGB. |
ExKeeper
Posts: 84/512 |
I don't understand that equation, but I just figured out that the palette editor will show it. |
blackhole89
Posts: 603/971 |
Originally posted by HyperHacker Well, SNES uses 15-bit colour AFAIK. So something like this should work: S = (B & 31) ^ ((G & 31) << 5) ^ ((R & 31) << 10) where S = SNES colour. ^ means XOR (you could use add, but XOR is faster ) and << means left-shift (multiply by 2; eg x << 5 means x multiplied by 2 5 times).
First off, it is the other way around, in other words, the blue colour component is the highest one. Second, you have to act a little bit different if you want to convert a 24-bit RGB colour to SNES.
S = ((R & 248) >> 3) ^ ((G & 248) << 2) ^ ((R & 248) << 7).
This one should be right. |
Smallhacker
Posts: 1417/2273 |
A few weeks ago, I was finally un-lasy enough to write a few functions that converts SNES colors to PC and vice versa. Maybe I should make a program out of them and release it? |
HyperLamer
Posts: 3903/8210 |
Well, SNES uses 15-bit colour AFAIK. So something like this should work: S = (B & 31) ^ ((G & 31) << 5) ^ ((R & 31) << 10) where S = SNES colour. ^ means XOR (you could use add, but XOR is faster ) and << means left-shift (multiply by 2; eg x << 5 means x multiplied by 2 5 times). |
ExKeeper
Posts: 77/512 |
the link seems to be dead. |
Shyguy
Posts: 350/1998 |
Useful Resources for SMW Hackers! (NEWBIES: READ THIS)
Read that thread for your color converting needs!!!!! |
ExKeeper
Posts: 76/512 |
Is there a way to convert PC RGB values to SNES RGB values? |