True color game - colors for GUI

Started by Sinitrena, Mon 30/05/2005 08:11:18

Previous topic - Next topic

Sinitrena

Normally I use hi-color, but I decided to work in true color this time. Now I wanted to find out the number for a color. In hi-color you simply look the color up in palette and use the number in the gui, but when I try this in true color, the shown color in palette and the GUI color are different when I use the number.
So, is this a bug or is there an other way to find out colors for true-color games? 

strazer

#1
Quote from: Pumaman on Fri 20/05/2005 20:11:10Hi-colour is 16-bit colour, in which Red, Green and Blue are represented by 5 bits each.
Therefore the accuracy of the hi-color video mode is down to 32 shades of each component.

AGS then keeps this method of selecting colours for 32-bit to make porting your game between 16-bit and 32-bit as painless as possible.

Sounds to me like you're limited to a hi-color palette.

Sinitrena

I looked at this thread, but unfortunetly it doesn't help at all. I still don't know what number I need for the GUI color.
To be more concret: The color I want has the RGB value 255, 128, 64. What is the AGS number for true color games?

strazer

It should be
  ((255/8)*2048) + ((128/8)*64) + (64/8) = 64520

but

Quotewhen I try this in true color, the shown color in palette and the GUI color are different when I use the number.

you're right, when I enter this number as the GUI background color, it displays as blue.
Seems like R and B are reversed, so the color you're looking for is actually

  ((64/8)*2048) + ((128/8)*64) + (255/8) = 17439

Looks like a bug to me.

Sinitrena

#4
Thank you so much, that's the right color!  :-*

EDIT: It seems to be a bug in the GUI editor: When using the calculation you proposed it looks right in the GUI editor but wrong in-game. Using the calculation from the other thread it looks wrong in the GUI editor but right in-game. It's a bit confusing, but now that I know this it doesn't matter for me anymore.

strazer

Quoteit looks wrong in the GUI editor but right in-game.

Ah, I also only tested it in the editor, not at run-time. Good to know.

Pumaman

Thanks for letting me know, this is a bug iwth the GUI Editor. I'll get it fixed for the next version.

GarageGothic

On a slightly different note, would it be possible to add a small piece of functionality to allow us to press CTRL+C on the palette screen to allow easy copy/pasting of the color number?


GarageGothic

Thanks strazer. As often before I fail to notice an existing suggestion. Sorry 'bout that.

strazer

No problem. Without a proper search function, it's sometimes hard to find stuff in the tracker. It's easier for me since I added most entries and know what to look for.

SMF spam blocked by CleanTalk