Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for rendering of UI accents and selection #134

Open
vlsi opened this issue Apr 10, 2020 · 2 comments
Open

Add test for rendering of UI accents and selection #134

vlsi opened this issue Apr 10, 2020 · 2 comments
Labels
Test Test

Comments

@vlsi
Copy link
Contributor

vlsi commented Apr 10, 2020

Accent and selection can be changed from the command line, so it should be possible to

  1. change settings via command line
  2. launch demo, capture screenshots

Here's the source: https://www.reddit.com/r/MacOS/comments/9xtg0y/switching_system_appearance_using_terminal/e9wemy8/

I'm not sure how to generate "UI style updated" in realtime, however, executing defaults write -g AppleAccentColor -int 3 before launching the demo works.

#  Appearance
defaults write -globalDomain "AppleInterfaceStyle" -string "Dark"
#  to Disable: delete entry

#  Accent colour
#  this setting defines two properties:
#    - AppleAccentColor
#    - AppleAquaColorVariant
#  it also presets AppleHighlightColor, but this can be overriden
#
#  note that AppleAquaColorVariant is alway "1" except for "Graphite", where it is "6".
#  note that the AccentColor "Blue" is default (when there is no entry) and has no AppleHighlightColor definition.
#
#  Color    AppleAquaColorVariant    AccentColor    AppleHighlightColor
#    Red            1                   0           "1.000000 0.733333 0.721569 Red"
#    Orange         1                   1           "1.000000 0.874510 0.701961 Orange"
#    Yellow         1                   2           "1.000000 0.937255 0.690196 Yellow"
#    Green          1                   3           "0.752941 0.964706 0.678431 Green"
#    Purple         1                   5           "0.968627 0.831373 1.000000 Purple"
#    Pink           1                   6           "1.000000 0.749020 0.823529 Pink"
#    Blue           1                   deleted     deleted
#    Graphite       6                   -1          "0.847059 0.847059 0.862745 Graphite"
defaults write -globalDomain "AppleAquaColorVariant" -int 6
defaults write -globalDomain "AccentColor" -int -1

#  Highlight colour
#  set to Pink
defaults write -globalDomain "AppleHighlightColor" -string "1.000000 0.749020 0.823529 Pink"
@weisJ
Copy link
Owner

weisJ commented Apr 10, 2020

Does defaults write -globalDomain "AppleHighlightColor" -string "1.000000 0.749020 0.823529 Pink" actually work for you. On github actions:

Runtime.getRuntime.exec("defaults write -globalDomain "AppleHighlightColor" -string \"1.000000 0.749020 0.823529 Pink\"");

produces 2020-04-10 20:12:11.994 defaults[1277:10469] Unexpected argument 0.733333; leaving defaults unchanged.

@weisJ weisJ added the Test Test label Apr 11, 2020
@weisJ weisJ linked a pull request Apr 11, 2020 that will close this issue
@weisJ
Copy link
Owner

weisJ commented Apr 11, 2020

Ok. Invoking the command specifically using bash -c does work. However the changes are only applied if the settings are reopened. Maybe this script could work:
https://apple.stackexchange.com/questions/332003/toggle-light-mode-dark-mode-and-accent-color-from-one-to-another

@weisJ weisJ removed a link to a pull request Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Test Test
Projects
None yet
Development

No branches or pull requests

2 participants