feat: 数据别名.
This commit is contained in:
@@ -36,10 +36,13 @@ public class HostSshConfigStrategy implements HostConfigStrategy<HostSshConfigMo
|
||||
|
||||
private static final int SSH_PORT = 22;
|
||||
|
||||
private static final String USERNAME = "root";
|
||||
|
||||
@Override
|
||||
public HostSshConfigModel getDefault() {
|
||||
return HostSshConfigModel.builder()
|
||||
.port(SSH_PORT)
|
||||
.username(USERNAME)
|
||||
.charset(Const.UTF_8)
|
||||
.connectTimeout(Const.MS_S_10)
|
||||
.fileNameCharset(Const.UTF_8)
|
||||
|
||||
@@ -48,7 +48,7 @@ public class TerminalThemeFetcher {
|
||||
.limit(200)
|
||||
.map(f -> {
|
||||
JSONObject schema = JSONObject.parseObject(new String(FileReaders.readAllBytes(f)));
|
||||
schema.put("dark", isDarkColor(schema.getString("background")));
|
||||
schema.put("dark", Colors.isDarkColor(schema.getString("background")));
|
||||
schema.put("selectionBackground", schema.getString("selection"));
|
||||
// 转为对象
|
||||
return JSON.parseObject(JSON.toJSONString(schema, colorFilter), TerminalTheme.class);
|
||||
@@ -69,19 +69,6 @@ public class TerminalThemeFetcher {
|
||||
System.out.println("\n\njsCode 已复制到剪切板");
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO kit
|
||||
* 是否为深色
|
||||
* 亮度值 < 128 ? 深色 : 128
|
||||
*
|
||||
* @param hex hex
|
||||
* @return 是否为深色
|
||||
*/
|
||||
public static boolean isDarkColor(String hex) {
|
||||
int[] rgb = Colors.toRgbColor(hex);
|
||||
return (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000 < 128;
|
||||
}
|
||||
|
||||
//
|
||||
/*
|
||||
var term = new Terminal();
|
||||
|
||||
Reference in New Issue
Block a user