Goland编辑器设置选择范围背景色的操作
作者:Jeffid 时间:2024-04-25 15:13:54
为了区分选择与未选择区域,,将已选择区域的文本背景色设置为浅蓝色是个很做法。
设置的路径在 Editor > Color Scheme > General > Editor > Selection background
下面以2018版的Goland为例,如图:
JetBrains出品的如phpStorm和webStorm等的设置也基本如此。
补充:Go语言:控制台输出有颜色的字
本方法只限用于 Windows系统
应用场景
需要输出大量信息的运行日志(一般是服务器,Windows系统的)
某类客户端的调试界面(一般是游戏,特别是有第三方模组的)
代码示例
package main
import (
"syscall"
)
var (
kernel32 *syscall.LazyDLL = syscall.NewLazyDLL(`kernel32.dll`)
proc *syscall.LazyProc = kernel32.NewProc(`SetConsoleTextAttribute`)
CloseHandle *syscall.LazyProc = kernel32.NewProc(`CloseHandle`)
// 给字体颜色对象赋值
FontColor Color = Color{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
)
type Color struct {
black int // 黑色
blue int // 蓝色
green int // 绿色
cyan int // 青色
red int // 红色
purple int // 紫色
yellow int // 黄色
light_gray int // 淡灰色(系统默认值)
gray int // 灰色
light_blue int // 亮蓝色
light_green int // 亮绿色
light_cyan int // 亮青色
light_red int // 亮红色
light_purple int // 亮紫色
light_yellow int // 亮黄色
white int // 白色
}
// 输出有颜色的字体
func ColorPrint(s string, i int) {
handle, _, _ := proc.Call(uintptr(syscall.Stdout), uintptr(i))
print(s)
CloseHandle.Call(handle)
}
func main() {
ColorPrint(`红色`, FontColor.red)
ColorPrint(`蓝色`, FontColor.blue)
ColorPrint(`白色`, FontColor.white)
}
以上为个人经验,希望能给大家一个参考,也希望大家多多支持asp之家。如有错误或未考虑完全的地方,望不吝赐教。
来源:https://blog.csdn.net/Jeffid/article/details/83279776
标签:Goland,编辑器,背景色
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python安装jieba库详细教程
2023-05-09 12:18:19
![](https://img.aspxhome.com/file/2023/5/84935_0s.png)
Python 使用 Pillow 模块给图片添加文字水印的方法
2022-06-13 04:13:37
![](https://img.aspxhome.com/file/2023/7/93607_0s.jpg)
深入理解ES6 Promise 扩展always方法
2024-04-18 09:46:46
FrontPage2002简明教程七:HTML在FrontPage中的应用
2008-09-17 11:33:00
![](https://img.aspxhome.com/file/UploadPic/200810/17/20081017113624552s.jpg)
使用PIL(Python-Imaging)反转图像的颜色方法
2022-12-15 19:16:48
ASP初学者常犯的几个错误
2007-09-07 10:19:00
![](https://img.aspxhome.com/file/UploadPic/2007-1/2007130163317843s.gif)
pytorch获取vgg16-feature层输出的例子
2021-04-16 20:56:47
php字符串截取函数mb_substr用法实例分析
2024-05-02 17:35:09
在ASP中用“正则表达式对象”来校验数据的合法性
2010-05-27 12:25:00
python实现日历效果
2022-07-20 22:22:57
![](https://img.aspxhome.com/file/2023/2/123622_0s.jpg)
浅谈Go语言中的结构体struct & 接口Interface & 反射
2024-05-22 10:30:50
一个查看MSSQLServer数据库空间使用情况的存储过程 SpaceUsed
2024-01-26 07:04:56
Python多线程中阻塞(join)与锁(Lock)使用误区解析
2022-03-22 08:00:31
简单谈谈python中的语句和语法
2023-03-03 12:03:13
儿童python练习实例
2023-12-13 04:26:32
Python转换字典成为对象,可以用"."方式访问对象属性实例
2021-06-01 09:01:50
解析mysql数据库还原错误:(mysql Error Code: 1005 errno 121)
2024-01-15 00:13:13
Centos6.5在线安装mysql 8.0详细教程
2024-01-15 01:02:57
pycharm配置QtDesigner的超详细方法
2022-09-07 13:35:01
![](https://img.aspxhome.com/file/2023/9/131129_0s.png)
python3.7添加dlib模块的方法
2023-09-16 03:58:55
![](https://img.aspxhome.com/file/2023/9/87749_0s.png)