Enable the User's Preferred Accent Colour to be Specified
As a dialog creator, I would like to be able to apply the colour chosen by the user via System Settings > Appearance > Accent Colour wherever macOS standard colour values are accepted. This should include the following:
- Title colour
- Message colour
- Icon colours when a Symbol is specified for the icon
Describe the solution you'd like
Allow a colour value of accent to enable this behaviour.
Describe alternatives you've considered
- Read the value and set it explicitly via hex at dialog creation. This adds extra work and does not allow the colour to change if the dialog is visible when the user edits their preference in System Settings.
Additional context Opened pull request #305 which includes an implementation of this enhancement.
This should already be the case. If you launch dialog using /usr/local/bin/dialog it will launch in the users context which will respect accent colour preferences. If you launch the binary directly and do so as root/system then you will get root's preferences which by default is blue.
I would have thought so, but a quick test reveals that the current logic does not function in that manner. I thought about introducing a unit test to cover this, but I don't think I have them configured properly and they failed to run... I may try that again later.
Fortunately, in lieu of the test, the declarative nature of SwiftUI means that I only need to do a project-wide search to determine that (.accentColor) is only utilized within the following:
DisplayImage("error" image colour)HelpButton(question mark label colour)TimerView(bar colour)CirclerPercentageProgressViewStyle(circle colour)
Pull request #305 adds an accent case to stringToColour(_:), allowing the user's preferred accent colour to be specified for any option handling logic which invokes that function, including:
- Title font colour
- Message font colour
- Icon (symbol) primary, secondary, and tertiary colours in
colour,color, andpalettemodes - Icon (symbol) "overlay" background colour
Note: I opened this as a feature request, not a defect, because the current behaviour properly matches the documentation.
color,colour=<text><hex>specified in hex format, e.g.#00A4C7Also accepts any of the standard Apple coloursblack, blue, gray, green, orange, pink, purple, red, white, yellowDefault if option is invalid is system primary colour
As shown above, the Icon docs specify that he default colour should be the primary colour, not accent. This is, in fact, the current behaviour when an invalid colour value (or no colour value) is specified. PR #305 does not change the default behaviour of using .primary, it simply adds an accent option to the list of available named colours above.
oh right - sorry, lack of coffee.....different issue.
as you were 🙂
was this one done or something? I'm trying to remember if that PR was to address the FR or something else.