Sign in Join

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

Mailing lists / lazarus / 2019-10

Default color of form in RGB?

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

John Landmesser
to Anthony Walter
Anthony Walter wrote 5 lines
Does anyone know of a reliable way get the default color of a form (as in clDefault) in RGB? I am writing some code to prepare bitmaps and I want their background to match the default color of a form. Unfortunately I don't see a way to convert clDefault to an RGB value.

Just an idea:

https://www.maketecheasier.com/color-picker-tools-for-linux/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20191013/0f324598/attachment.html>

Reply by email

Anthony Walter
to John Landmesser

Okay, you made me laugh, but I hope you were joking. Just to be clear I don't mean to ask how to get the color of something on my screen, I meant how to calculate at runtime the default color of a form in RGB on all platforms without having to take a screenshot of the form. -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20191013/3f6e5c03/attachment-0001.html>

Reply by email

Bart
to Anthony Walter: Does anyone know of a reliable way get the default color of a form (as in clDefault) in…
PM Anthony Walter wrote
Does anyone know of a reliable way get the default color of a form (as in clDefault) in RGB? I am writing some code to prepare bitmaps and I want their background to match the default color of a form. Unfortunately I don't see a way to convert clDefault to an RGB value.

Asked a similar question once before.
Here's Zeljko's answer to that:

No, clDefault is incorrect at any time. To obtain color we have:
     function GetColorResolvingParent: TColor;
     function GetRGBColorResolvingParent: TColor;
Bart

Reply by email