![]() ![]() ![]() Once you have defined a colour set, you can retrieve the colour in your draw(_ dirtyRect:) as follows: let strokeColour = NSColor(named: NSColor.Name("gridColour")) ? NSColor.black This defines a colour that will be white in dark mode and black in light mode or on legacy operating systems. You will then get three colour wells, "any" is for legacy operating systems that do not support dark mode, "light" and "dark" should be obvious. Having defined your colour set, in the inspector, set the device to "Mac" and the appearance to "Any, Light, Dark". This means defining a "colour set" for each colour you want to use in the assets catalog. The thing to do is to stop using absolute colours and start using semantic colours. However, if they only want to change the colour of some custom view, this is the Apple blessed way. If they want completely different behaviour of their app, the below behaviour doesn't work. This isn't a complete answer to the question because the questioner doesn't say what their use case is. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |