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

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


On Fri, Oct 21, 2011 at 9:25 AM, Graeme Geldenhuys
<graemeg.lists at gmail.com> wrote:
> In fpGUI have have a fpgColorToRGBColor() - this will lookup and
> translate (if required) "color aliases" to real RGB values. If memory
> serves me right, Delphi (and probably Lazarus too) has a similar call?
> Try something like ColorToRGB(CDPageControl1.Color) and see if that does
> the trick.

Yes, that's how it worked before clDefault was introduced, but
clDefault has no meaning at all, it depends on the control! And if you
pass clDefault around by means of ParentColor, for example, then you
loose the information of which control originally specified it. Also,
it seams that on my Windows I get no information to which color
clDefault is for my form.

Maybe we should have instead created 1 color for each native control,
like: clFormDefault, clPageControlDefault, etc.

-- 
Felipe Monteiro de Carvalho




More information about the Lazarus mailing list