[Lazarus] Default color of form in RGB?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Default color of form in RGB?

Free Pascal - Lazarus mailing list
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.

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default color of form in RGB?

Free Pascal - Lazarus mailing list
Am 13.10.19 um 21:55 schrieb Anthony Walter via lazarus:
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/


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default color of form in RGB?

Free Pascal - Lazarus mailing list
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.

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default color of form in RGB?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Sun, Oct 13, 2019 at 9:56 PM Anthony Walter via lazarus
<[hidden email]> 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
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Default color of form in RGB?

Free Pascal - Lazarus mailing list
Bart, that was exactly what I was looking for. Thank you so much!

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus