[Lazarus] How to obtain the color of a component?

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Fri Oct 21 10:23:38 CEST 2011


On Fri, Oct 21, 2011 at 10:19 AM, Paul Ishenin <ip at kmiac.ru> wrote:
> if CDTabControl.Color = clDefault then
>  lColor := ColorToRGB(CDTabControl.GetDefaultColor(dctBrush))
> else
>  lColor := ColorToRGB(CDTabControl.Color);
>
> This should work ^.

Ok, thanks, this indeed works =) I did not expect GetDefaultColor to
resolve ParentColor, but it does.

But I still think we introduced a "gotcha" in the sense that GetColor
no longer returns a good color solving clDefault.

Maybe GetColor should call GetDefaultColor if the color is clDefault?

-- 
Felipe Monteiro de Carvalho




More information about the Lazarus mailing list