Specific RGB values give wrong tint color

Started by Honza, Fri 24/02/2023 16:53:52

Previous topic - Next topic

Honza

As part of a day/night cycle, I'm using ambient tint with gradually changing RGB values (so that a reddish sunset tint slowly goes through purple to eventually change into night blue, etc.). And I've noticed that specific RGB combinations give strange results.

For instance, the value 26/20/37 should be purple, but tints the character turquoise. All surrounding combinations - 27/20/37, 25/20/37, 26/21/37, 26/19/37, 26/20/38, 26/20/36 - are appropriately purple. The same thing happens for the combinations 31/21/35, 30/21/35 - they are greenish blue instead of purple, as if the r value was 0.



I can manually find the problematic combinations and have the script avoid them, but I was wondering what was causing this. I'm using AGS 3.6.0.39

eri0o

#1
It's probably converting RGB colors to AGS colors, and AGS uses a curious color representation that has a palette in it's initial values. I think it's like 5bit Red, 6bit Green and 5bit Blue, and if R and G are 0 then Blue is palette index.

I also don't remember if color is relative when tinting (is 32,0,0 the same as 255, 0,0?).

Maybe this thread from @Snarky helps

http://www.adventuregamestudio.co.uk/forums/index.php?topic=43311

Or this other one

http://www.adventuregamestudio.co.uk/forums/index.php?topic=34391.msg451781#msg451781

Curiously at the beginning of this thread CJ was still around so he explains the tinting process in AGS. I believe it's exactly the same for backwards compatibility.

Honza

Thank you, this clarifies it! I'll just work around it then.

SMF spam blocked by CleanTalk