如何将整个 Xcode IDE 主题设置为亮暗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2692817/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to theme the ENTIRE Xcode IDE to light-on-dark?
提问by pokkimon
On OSX, MacVim and Terminal can both be themed to be light-on-dark. Xcode 3.2 allow the same customization for its editor using color schemes.
在 OSX 上,MacVim 和终端都可以主题为明暗。Xcode 3.2 允许使用配色方案对其编辑器进行相同的自定义。
However, is there a way to do the same to its UI panels ("Groups and Files" left pane and the list view top pane for example)? If not, is there a quick way to toggle both panels on/off?
但是,有没有办法对其 UI 面板(例如“组和文件”左窗格和列表视图顶部窗格)执行相同的操作?如果没有,是否有一种快速打开/关闭两个面板的方法?
回答by Jbryson
While you can't adjust the IDE color scheme, you can quickly toggle the navigator, debug area, and utility views with the following commands:
虽然您无法调整 IDE 配色方案,但您可以使用以下命令快速切换导航器、调试区域和实用程序视图:
Navigator : ?0
导航器 : ?0
Debug Area : ??Y
调试区:??Y
Utility : ??0
效用:??0
So, if you set your theme to one with a dark background, you can quickly close/open the lighter portions of the IDE as needed.
因此,如果您将主题设置为具有深色背景的主题,则可以根据需要快速关闭/打开 IDE 的较亮部分。
You can also change the debug console to have a different background by going into preferences ?.
, then go to Fonts & Colors, then select the Console. Now you can edit its background:
您还可以更改调试控制台有通过进入偏好不同的背景?.
,然后去字体和颜色,然后选择控制台。现在您可以编辑其背景:
Just be sure to edit the font colors of the various input and outputs texts if you choose black. By default all of the input/output fonts are black, only the console prompt is not.
如果您选择黑色,请务必编辑各种输入和输出文本的字体颜色。默认情况下,所有输入/输出字体都是黑色的,只有控制台提示不是。
回答by Paul R
One possibility for now: System Preferences
=> Accessibility
=> Display
=> Invert Colors
.
现在的一种可能性:System Preferences
=> Accessibility
=> Display
=> Invert Colors
。
Note that Apple recently announced at WWDC that Xcode 10 will support "dark mode" as of some time in late 2018.
请注意,Apple 最近在 WWDC 上宣布 Xcode 10 将在 2018 年末的某个时间支持“黑暗模式”。
回答by Repose
One cool workaround for this is to use a combination of
一个很酷的解决方法是使用组合
- "Invert Colors" (in System Preferences -> Accessibility -> Display -> Invert Colors OR setting up a "Ctrl-Opt-Cmd-8" shortcut in System Preferences -> Keyboard -> Shortcuts -> Accessibility -> Invert Colors) and
- Choosing your favourite dark theme in Xcode's "Fonts & Colors", but inverted (!).
- “反转颜色”(在系统偏好设置 -> 辅助功能 -> 显示 -> 反转颜色或在系统偏好设置 -> 键盘 -> 快捷方式 -> 辅助功能 -> 反转颜色中设置“Ctrl-Opt-Cmd-8”快捷方式)和
- 在 Xcode 的“Fonts & Colors”中选择你最喜欢的深色主题,但是倒置(!)。
For example, I like a Choco theme from Chocolat app, but I need the functionality of Xcode, so I imported the theme manually by adjusting and enhancing some of the fonts and colors in some Xcode's custom dark theme's duplicate. After I was happy with the final theme, I duplicated it and inverted the colors using one of the websites that can be found in Google (http://www.mattlag.com/scripting/hexcolorinverter.php). And voila! "Ctrl-Opt-Cmd-8" + "Inverted Dark Theme" makes the whole Xcode environment dark and looking great, without the need of hiding any other sections of Xcode like Navigator, Debug and Utilities.
例如,我喜欢 Chocolat 应用程序中的 Choco 主题,但我需要 Xcode 的功能,因此我通过调整和增强某些 Xcode 自定义深色主题副本中的某些字体和颜色来手动导入主题。在我对最终主题感到满意后,我复制了它并使用可以在 Google 中找到的网站之一反转颜色(http://www.mattlag.com/scripting/hexcolorinverter.php)。瞧!"Ctrl-Opt-Cmd-8" + "Inverted Dark Theme" 使整个 Xcode 环境变暗且看起来很棒,无需隐藏 Xcode 的任何其他部分,如 Navigator、Debug 和 Utilities。
Let me know if this solution helps. I find it a little time consuming, but worth the effort.
如果此解决方案有帮助,请告诉我。我觉得这有点耗时,但值得付出努力。
p.s.: I've posted the discussed themes on GitHub: https://github.com/Rep0se/xcode-themes
ps:我已经在 GitHub 上发布了讨论的主题:https: //github.com/Rep0se/xcode-themes
p.p.s: To theme FileMerge tool in Mojave (for now) use thissolution in combination with Invert Colors outlined above.
pps:要在 Mojave 中设置主题 FileMerge 工具(目前),请将此解决方案与上面概述的反转颜色结合使用。
Quick shortcut Tip: To launch preferences, hit "Command" + ","
快捷方式提示:要启动首选项,请点击“Command”+“,”
回答by bpruitt-goddard
WWDC 2018 announced that Xcode 10 on macOS 10.14 will finally include native dark mode support. This will be available around Q3 2018. It will be a full dark style from the side menus to storyboards.
WWDC 2018 宣布 macOS 10.14 上的 Xcode 10 最终将包含原生暗模式支持。这将在 2018 年第 3 季度左右推出。从侧面菜单到故事板,它将是一个完全黑暗的风格。
回答by Filippo
You can turn to full dark mode with the new macOS Mojave. Simply go to System settings->General and switch to dark. Enjoy!!!
您可以使用新的 macOS Mojave 切换到完全黑暗模式。只需转到系统设置->常规并切换到黑暗。享受!!!
回答by Dominik Bucher
I've been digging around lately and I found some kind of "Hack" of DVT Framework myself... Xcode 10 with dark theme is however around the corner, so there will be no need for this hacking anymore... Anyway you can do nice thingies with this such as changing Highlight colors for buttons and plist-file browsers... If you open Xcode with Show Package Contents
and browse a bit, you can find this nice file:
我最近一直在挖掘,我自己发现了某种 DVT 框架的“Hack”......但是带有深色主题的 Xcode 10 即将到来,所以不再需要这种黑客......无论如何你可以用它做一些不错的事情,例如更改按钮和 plist 文件浏览器的突出显示颜色...如果您打开 XcodeShow Package Contents
并浏览一下,您可以找到这个不错的文件:
/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Versions/A/Resources/Default.dvttheme
/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Versions/A/Resources/Default.dvttheme
You can open this either with Visual Studio Code
or Atom
or any code editor.
您可以使用Visual Studio Code
或Atom
或任何代码编辑器打开它。
From now on, you can do some hacking and change some of the colors in the Xcode IDE:
从现在开始,您可以在 Xcode IDE 中进行一些修改并更改一些颜色:
But somehow, due to nature of Aqua theme/user interface, you cannot change the scrollViews, which is a bit disappointing... When you could, I would already create repo which would have all the craziness of colors for this. If you want, you can change at least plistViewer and the Attributes inspector windows (The properties are called and documented nice in Default.dvttheme
但不知何故,由于 Aqua 主题/用户界面的性质,您无法更改滚动视图,这有点令人失望......如果可以,我已经创建了具有所有疯狂颜色的 repo。如果需要,您可以至少更改 plistViewer 和属性检查器窗口(这些属性在Default.dvttheme
Hope this helps a bit.
希望这个对你有帮助。
edit:
编辑:
What you could do is to edit the default Aqua theme with ThemeEngine
https://github.com/DominikBucher12/ThemeEngine
您可以做的是使用https://github.com/DominikBucher12/ThemeEngine编辑默认的 Aqua 主题ThemeEngine
(Change assets to black/dark) and the Xcode would inherit this Appearance..
(将资产更改为黑色/深色)并且 Xcode 将继承此外观..
回答by brokenrhino
There is an Xcode project that has a huge collection of themes, both light and dark. My favorite is Moodnight. https://github.com/hdoria/xcode-themes
有一个 Xcode 项目,其中包含大量主题,包括浅色和深色。我最喜欢的是Moodnight。 https://github.com/hdoria/xcode-themes