[Module] LED - Gadget (all OS)

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
hoerbie
Enthusiast
Enthusiast
Posts: 119
Joined: Fri Dec 06, 2013 11:57 am
Location: DE/BY/MUC

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

Post 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?
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

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

Post 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.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply