Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Delphi 7 and DBPro 16 Million colors.

Author
Message
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 14th Sep 2003 16:09
OK Delphi 7 and 6 both have 16 million colours.
I got a color box in delphi7. got it to write the colour value. and got dbpro to colour an color bakcdorp in that colour (16 million value not RGB). it seems delphi 7 and dbpro use oppostie colours :S.

Red is Blue
Blue is Red

white and black are ok
but the in between is wierd.

So whos right and who is wrong. Is anyone wrong. Is there anyway of getting the right colors. Preferable db to convert the delph color to the right one sort of.

x=1238782
convert delphi colour x
print "",x

would print a new colour which would be the correct color.

obviously im not asking for a new command. im just illstrating what i would want to do.

Basically when you select red in a colour box. and get the colour value that delphi 7 used. and use that same value in dbpro, you find that the dbpro value is opposte to delphi 7. i.e. red value in delphi 7 is blue value in dbpro.

anyopne know how to change this?

>>TerraByte. Putting the Byte back into Terragramming<< Life is like a sheet sandwich you take a bigger piece everyday.
OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 14th Sep 2003 16:44
Whenever you want to specify a colour, use the RGB value and not just a number - this way the colour you specify will be the same in all graphics modes (or at least the nearest equivilent).

Likewise, you always get a RGB colour from a colour box, which is a 32-bit number, so red is always around $00FF0000 - 16711680 decimal. I dont see Delphi being different to any other language.


Avatar & Logo by Indi. Come to the UK DBPro Convention in Chichester
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 14th Sep 2003 16:49
I have two functions in Delphi code for converting between the two colour formats:


At the top of your code, you need a CustomDWORD type:



DarkBASIC RGB to Delphi TColor:



Delphi TColor to DarkBASIC RGB



Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 14th Sep 2003 17:00
sorry rob er.. i put the first snippet at the vey top of delphi 7 code.

and i need (part) of the 3rd one in my procedure in delphi 7 where i am writting the colorbox value. is that correct. and the value i write to the document is Result

>>TerraByte. Putting the Byte back into Terragramming<< Life is like a sheet sandwich you take a bigger piece everyday.

Login to post a reply

Server time is: 2026-07-23 15:48:52
Your offset time is: 2026-07-23 15:48:52