Eclipse中代码颜色的自定义设置:
对于长期从事编程的人员而言,Java的操作界面如果是默认的白色,容易让人产生视觉疲劳,同时对视力会产生影响。所以设定一份科学的背景颜色显得十分有必要。
设置背景颜色:
- Window—>Preference—>General—>Text Editors
在右边框的下方有一个Appearance color options框,如下图所示
- 点击Background color —>Color(注释:如果勾选了System Default,取消勾选),单击color后,—>Apply–>OK
本文推荐:色调:85 饱和度:123 亮度:205 - 单击Current line highlight—>Color
本文推荐:白色
设置字体:
- Window—>Preferences—>General—>Appearance—>Colors and Fonts
在右边框的上部分有Colors and Fonts,如下图所示: - 单击Java—>Java Editor Text Font(…)—>Edit…
选择一款自己喜欢的字样。—>Apply—>OK
本文推荐:Calibri 常规 五号
代码颜色设置:
- 实际原图:
- 实现步骤:windows->Preferences->Java->Editor->Syntax Coloring
按照上图的顺序提示,然后根据下面的表,将对应的值修改即可,修改时只要修改红,绿,蓝的比值即可。
名称 | 红,绿,蓝的值 | 颜色 |
---|---|---|
Annotations(注释): | 107, 147, 186 | 浅蓝色 |
Deprecated members(不建议使用的成员): | 0, 0, 0 | 黑色 |
Fields(字段): | 128, 0, 128 | 紫色 |
KeyWord ‘return’(关键字’return’): | 255, 0, 0 | 红色 |
Keyword excluding ‘return’(除了关键字以外的return): | 255, 128 ,0 | 橙色 |
Local variable declarations(局部变量声明): | 128, 128, 128 | 灰色 |
Method declarations(方法声明): | 255, 128, 64 | 橙色 |
Method(方法): | 0, 48, 96 | 暗浅蓝色 |
Operators and brackets(运算符与方括号): | 255, 128, 0 | 橙色 |
Others(其他): | 96 153, 0 | 深绿色 |
Static fields(静态字段): | 33, 0, 189 | 深蓝色 |
Static Method invocations(静态方法调用): | 77, 166 255 | 天蓝色 |
Strings(字符串): | 132, 26, 238 | 中天蓝色 |
Type variables(类型变量): | 128, 0, 25 | 红罗色 |