Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » al_map_rgb()

Credits go to LennyLen and pkrcel for helping out!
This thread is locked; no one can reply to it. rss feed Print
al_map_rgb()
sai pavan boddu
Member #14,787
December 2012

Hello all,

I am going through the basic tutorials of allegro 5, so to change the display color there is function al_clear_to_display(), which takes the argument al_map_rgb(0,0,0).

In the Tutorial it is well explained that 0,0,0 are the values of RED, GREEN & BLUE . So in that case if we change r,g,b values we should have a change of colour in the display.

But that is not happening when I try with different values. The display remains Black irrespective of the values(r,g,b).

Any reason for this problem?

You can find the code at "http://wiki.allegro.cc/index.php?title=Allegro_5_Tutorial/Displays"

Thank you.

Thomas Fjellstrom
Member #476
June 2000
avatar

Have you flipped the display after clearing the screen?

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Thomas Fjellstrom
Member #476
June 2000
avatar

Edgar: given he's changed it, there no guarantee that's still there.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

pkrcel
Member #14,001
February 2012

With which values are you trying? those are int values ranging from 0 to 255.

just sayin'

It is unlikely that Google shares your distaste for capitalism. - Derezo
If one had the eternity of time, one would do things later. - Johan Halmén

sai pavan boddu
Member #14,787
December 2012

Edgar & Thomas : Yes I had flipped the dispaly

pkrcel : I gave inputs like (2,5,5)&(28,32,56)

?????? Does that problem any thing to do with, static and dynamic linking?

LennyLen
Member #5,313
December 2004
avatar

Quote:

pkrcel : I gave inputs like (2,5,5)&(28,32,56)

The first set of values will give a colour that is most likely indistinguishable from black. The second set should definitely be noticeably different though.

Does that problem any thing to do with, static and dynamic linking?

No.

Post the full final code that exhibits the problem.

sai pavan boddu
Member #14,787
December 2012

Oh! Brilliant , that worked for even higher values than what I mentioned .

Kris Asick
Member #1,424
July 2001

White = 255,255,255

Any values below 48 are going to be difficult to notice, especially if there's no comparison.

There's also floating-point versions of the map_rgb commands that take values from 0.0 to 1.0 instead of 0 to 255.

--- Kris Asick (Gemini)
--- http://www.pixelships.com

pkrcel
Member #14,001
February 2012

to me also the 2nd set of values gives a color VEEEERY close to black.

please try with something like magenta (255, 0, 255) and tell us what you get, please.

EDIT: missed that it was already sorted.....well CVD.

It is unlikely that Google shares your distaste for capitalism. - Derezo
If one had the eternity of time, one would do things later. - Johan Halmén

LennyLen
Member #5,313
December 2004
avatar

pkrcel said:

to me also the 2nd set of values gives a color VEEEERY close to black.

It could be your monitor settings. When I ran it, there was a console window behind that was black so the difference was pretty clear.

Arthur Kalliokoski
Second in Command
February 2005
avatar

{"name":"brightness_contrast_setting.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/c\/ac68cc994b8fdb9bfabe20ad908132fc.png","w":720,"h":540,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/c\/ac68cc994b8fdb9bfabe20ad908132fc"}brightness_contrast_setting.png

They all watch too much MSNBC... they get ideas.

Go to: