wxl_function 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/wxl_function.rb +62 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4ff3d66b41d67209675ae21758f987eee30c2a5288870cd5db90cffcad5e078d
|
|
4
|
+
data.tar.gz: e49dda040388e47a3cf0f854642cb0d951f35c7c6642cfd74fe9a10c8e6bc922
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 65542d3c8ace64de276bf460bd22fced8e20c291e41a375e73cdb0fc1d45fe752dda8c71b9c92563f539db7336791f30719406114a32a1fad5c9947646bbbc6f
|
|
7
|
+
data.tar.gz: '0842a3cfd980baaef5f506db0eff606738ad5efb9d77be05c77cf1965fc9655dad65fe79a9183c425e8960a41a84888ab7f197b13dfd6f2d32415ec3d77c9363'
|
data/lib/wxl_function.rb
CHANGED
|
@@ -21,8 +21,67 @@ module M_公共函数
|
|
|
21
21
|
Random.new.rand 最大值
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
def 多色显示(字符,颜色,背景,显示控制)
|
|
25
|
+
颜色码=''
|
|
26
|
+
case 颜色
|
|
27
|
+
when "黑色"
|
|
28
|
+
颜色码='30'
|
|
29
|
+
when "红色"
|
|
30
|
+
颜色码='31'
|
|
31
|
+
when "绿色"
|
|
32
|
+
颜色码='32'
|
|
33
|
+
when "黄色"
|
|
34
|
+
颜色码='33'
|
|
35
|
+
when "蓝色"
|
|
36
|
+
颜色码='34'
|
|
37
|
+
when "紫色"
|
|
38
|
+
颜色码='35'
|
|
39
|
+
when "青色"
|
|
40
|
+
颜色码='36'
|
|
41
|
+
when "灰色"
|
|
42
|
+
颜色码='37'
|
|
43
|
+
when "白色"
|
|
44
|
+
颜色码='38'
|
|
45
|
+
else
|
|
46
|
+
颜色码='38' #默认白色
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
背景码=''
|
|
50
|
+
case 背景
|
|
51
|
+
when "黑色"
|
|
52
|
+
背景码='40'
|
|
53
|
+
when "红色"
|
|
54
|
+
背景码='41'
|
|
55
|
+
when "绿色"
|
|
56
|
+
背景码='42'
|
|
57
|
+
when "黄色"
|
|
58
|
+
背景码='43'
|
|
59
|
+
when "蓝色"
|
|
60
|
+
背景码='44'
|
|
61
|
+
when "紫色"
|
|
62
|
+
背景码='45'
|
|
63
|
+
when "青色"
|
|
64
|
+
背景码='46'
|
|
65
|
+
when "灰色"
|
|
66
|
+
背景码='47'
|
|
67
|
+
else
|
|
68
|
+
背景码='40' #默认黑色
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
控制码=''
|
|
72
|
+
case 显示控制
|
|
73
|
+
when "高亮"
|
|
74
|
+
控制码='01'
|
|
75
|
+
when "下划线"
|
|
76
|
+
控制码='04'
|
|
77
|
+
when "闪烁"
|
|
78
|
+
控制码='05'
|
|
79
|
+
else
|
|
80
|
+
控制码='01' #默认黑色
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
return "\033[#{颜色码};#{背景码}m\33[#{控制码}m#{字符}\033[0m"
|
|
25
84
|
end
|
|
26
85
|
|
|
27
|
-
|
|
28
|
-
|
|
86
|
+
module_function :退出消息,:随机字符串,:随机数字,:多色显示
|
|
87
|
+
end
|