Sign in Join

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

Mailing lists / lazarus / 2014-11

System color to TFPColor

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Krzysztof

Hi,

I need to convert system color (like clHighlight, clBtnText etc) into TFPColor. Function TColorToFPColor has comment "does not work on system color" and indeed it doesn't work (I always get black color). Many other color functions has this same comment. How to workaround this?

Regards

Reply by email

Mattias Gaertner
to Krzysztof
Ok solved by TColorToFPColor(ColorToRGB(clHighlight))

Yes, but keep in mind that system colors are context sensitive. a clHightlight might be a different color on a TButton and on a TForm. And system colors depend on using as a Brush, Pen or Font.

Mattias

Reply by email