Board index » delphi » Can D2 do color codes like this?

Can D2 do color codes like this?

I need to get a number code from the Delphi colors like so:

Delphi                                  I need
=====                                   ======
red = 255                               red = -16776960

ash
abass at iname dot com

 

Re:Can D2 do color codes like this?


Ash -

Probably, but the match up seems to be a bit problematical. For
example, +16776960 (note the sign change) is RGB(0, 255, 255), or Cyan
- there's no Red involved. If you want the inverse of a color, you can
xor the low order 24 bits of the color - RGB(255, 0, 0) xor $00FFFFFF
will give you the +16776960.

That's probably very confusing - can you be more specific about what
you're trying to do?

Good luck.

Kurt

Re:Can D2 do color codes like this?


I'm writing a little thing which will change the registry for Lotus
WordPro such that the program's page margin color is of user choice.

The code for red below comes from WordPro itself. The manual method of
updating this marginscolor property is to make a change to another
item within the program and to then create the entry in the registry
by copying that items color code string into it. In WordPro, changing
the text highlight color to red results in the number -16776960.
Another color code of theirs is -65536 for yellow. This one is really
odd in that I believe 65535 is a usable code in Delphi for yellow, but
that same number in WordPro results in black.

ash

On Tue, 17 Feb 1998 02:22:42 GMT, 71333.2...@compuserve.com (Kurt

Quote
Barthelmess (TeamB)) wrote:
>Ash -

>Probably, but the match up seems to be a bit problematical. For
>example, +16776960 (note the sign change) is RGB(0, 255, 255), or Cyan
>- there's no Red involved. If you want the inverse of a color, you can
>xor the low order 24 bits of the color - RGB(255, 0, 0) xor $00FFFFFF
>will give you the +16776960.

>That's probably very confusing - can you be more specific about what
>you're trying to do?

>Good luck.

>Kurt

Re:Can D2 do color codes like this?


Ash -

Sorry, but I'm now out of my depth. I have no idea how WordPro stores
its colors.

Good luck.

Kurt

Other Threads