Page 2 of 2

Re: [Module] LED - Gadget (all OS)

Posted: Tue Apr 07, 2020 10:42 am
by hoerbie
Thanks, mk-soft. On my iMac the following works:

Code: Select all

Procedure OSX_GadgetColor()
  Define.i UserDefaults, NSString
		  
  UserDefaults = CocoaMessage(0, 0, "NSUserDefaults standardUserDefaults")
  NSString = CocoaMessage(0, UserDefaults, "stringForKey:$", @"AppleInterfaceStyle")
  If NSString And PeekS(CocoaMessage(0, NSString, "UTF8String"), -1, #PB_UTF8) = "Dark"
    ProcedureReturn BlendColor_(OSX_NSColorByNameToRGB("controlBackgroundColor"), #White, 82)
  Else
    ProcedureReturn BlendColor_(OSX_NSColorByNameToRGB("windowBackgroundColor"), #White, 85)
  EndIf 
  
EndProcedure  
Do you know if the blend values are different on different Macs or with standard colors always the same?

Re: [Module] LED - Gadget (all OS)

Posted: Tue Apr 07, 2020 12:59 pm
by mk-soft
Something like not. For me at time 87%

It also depends on how much the monitor is adjusted, or the current background is set,
But they didn't find out which transparency is currently used for the corresponding setting or even the current time.