Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

#1 2013-04-09 14:41:21

dalton
New member
Registered: 2009-01-05
Posts: 6

cgb colors

Hi,

does anybody know a good way of describing the colors of the cgb lcd? Assuming you have some RGB components in a picture on your computer, the naive (linear scaling) approach to get gameboy components gives completely different colors.

Pandocs suggest using subtracting half the range before scaling, but also acknowledges that it is not exactly perfect.

BGB has good colors, so there must be a somewhat accurate model. Does anybody have an idea?

Cheers

Dalton

Offline

 

#2 2014-04-21 05:04:55

UraKn0x
New member
Registered: 2014-04-19
Posts: 7

Re: cgb colors

The range of each component is from 0 to 31. And GBDK defines a RGB macro by :
#define RGB(r, g, b) ((((UWORD)(b) & 0x1f) << 10) | (((UWORD)(g) & 0x1f) << 5) | (((UWORD)(r) & 0x1f) << 0))
The returned value is an unsigned word (unsigned 16bit value).

Hope that will help you!

Offline

 

#3 2014-04-23 05:03:28

dalton
New member
Registered: 2009-01-05
Posts: 6

Re: cgb colors

Thank you for your reply, but what I had in mind was not how to define an rgb constant.

What I'm wondering is how the rgb color actually translates to a color. The Gameboy colors are sort of saturated... washed out. Is there any way to model this property?

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson