Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2014-12

red( clGrayText)

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Philippe

using -Cr (Range Check) option, red( clGrayText) as example, throw an exception!

how should I program "red" (or green, blue and may be some others) functions to avoid that?

should I write red( clGrayText
and $ffffff) ? ... another better way?

Philippe

Reply by email

Philippe
to Mattias Gaertner
Mattias Gaertner wrote
On Mon, 01 Dec

2014 15:17:04 -0200

Philippe wrote: >

using -Cr (Range Check) option, red( clGrayText) as example, throw an exception! how should I program "red" (or green, blue and may be some others) functions to avoid that? should I write red( clGrayText and $ffffff) ? ... another better way?

Have you read this?

http://wiki.lazarus.freepascal.org/Colors#System_colors [1]

Mattias

I have seen it ... but did not catch that it may not work

with red( x) ... making it more simple, it means that the range of values used for those constants as clGrayText is not TColor compatible. Is that correct?

_______________________________________________

fpc-pascal maillist -

http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [2]

Links:
------
[1]
http://wiki.lazarus.freepascal.org/Colors#System_colors [2]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Mattias Gaertner
to Philippe
Show quoted text 7 lines
[...] http://wiki.lazarus.freepascal.org/Colors#System_colors [1] > > I have seen it ... but did not catch that it may not work with red( x) ... making it more simple, it means that the range of values used for those constants as clGrayText is not TColor compatible. Is that correct?

clGrayText is a TColor, but TColor is not always a simple RGB value. System colors are context sensitive.
You might try

Red(ColorToRGB(clGrayText));

Mattias

Reply by email

Philippe
to Mattias Gaertner
Mattias Gaertner wrote
On Mon, 01 Dec

2014 22:01:15 -0200

Philippe wrote: >

[...] http://wiki.lazarus.freepascal.org/Colors#System_colors [1][1]

> >> I have seen it ... but did not catch that it may not work > with

red( x) ... making it more simple, it means that the range of values used for those constants as clGrayText is not TColor compatible. Is that correct?

clGrayText is a TColor, but TColor is not always a simple

RGB value.

System colors are context sensitive. You might try
Red(ColorToRGB(clGrayText));
Show quoted text 5 lines
Mattias working fine ! Thank

you.

_______________________________________________ fpc-pascal

maillist -

http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [2]

Links:
------
[1]
http://wiki.lazarus.freepascal.org/Colors#System_colors [2]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email