Recent

Author Topic: Way to Resolve clDefault Color for a Control At Runtime?  (Read 240 times)

Dan3468298

  • Full Member
  • ***
  • Posts: 128
Way to Resolve clDefault Color for a Control At Runtime?
« on: July 20, 2020, 10:17:03 pm »
Is there a way to resolve a control's color at run-time if its color is set at design-time to clDefault?  Specifically, on MacOS for TPanel, clDefault is returned as its color.   Say I want to set a Label.Color to Panel.Color so they match.
MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2515
    • havefunsoft.com
Re: Way to Resolve clDefault Color for a Control At Runtime?
« Reply #1 on: July 20, 2020, 10:39:15 pm »
Say I want to set a Label.Color to Panel.Color so they match.
it's almost impossible for macOS.
macOS interface is using transparency effect a lot, so at some point of time, it might turn out that Panel.Color is transparent at all time.
OR
are you trying to match the border color of a panel to the label color of the font?

if you're trying to hide the label then you should explicitly set visible to false.
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

Dan3468298

  • Full Member
  • ***
  • Posts: 128
Re: Way to Resolve clDefault Color for a Control At Runtime?
« Reply #2 on: July 22, 2020, 02:24:35 am »
I was just wondering if it was possible.  I wanted to match the Button color and I did it manually using the Gray Slider.   Thanks!
MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

 

TinyPortal © 2005-2018