1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
|
Module TerminalColorSystem
'GUIDE to COLORS in TERMINAL
'Using the same Hexadecimal numbering as what Command Prompt used to:
'0 = Black 8 = Gray
'1 = Blue 9 = Light Blue
'2 = Green A = Light Green
'3 = Aqua B = Light Aqua
'4 = Red C = Light Red
'5 = Purple D = Light Purple
'6 = Yellow E = Yellow
'7 = Dark Gray F = White
Public BgColor As Color
Public FgColor As Color
Public Sub DisplayColors()
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "TERMINAL SUPPORTED COLORS" & Environment.NewLine & Environment.NewLine
If Strings.AvailableFeature(10) = "1" Then
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "0 = Black 8 = Gray"
Else
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "0 = Black 8 = ???"
End If
If Strings.AvailableFeature(14) = "1" Then
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "1 = Blue 9 = Light Blue"
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "2 = Green A = Light Green"
Else
If Strings.AvailableFeature(13) = "1" Then
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "1 = ??? 9 = Light Blue"
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "2 = Green A = ???"
Else
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "1 = ??? 9 = ???"
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "2 = ??? A = ???"
End If
End If
If Strings.AvailableFeature(15) = "1" Then
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "3 = Aqua B = Light Aqua"
Else
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "3 = ??? B = ???"
End If
If Strings.AvailableFeature(14) = "1" Then
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "4 = Red C = Light Red"
ElseIf Strings.AvailableFeature(13) = "1" Then
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "4 = ??? C = Light Red"
Else
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "4 = ??? C = ???"
End If
If Strings.AvailableFeature(15) = "1" Then
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "5 = Purple D = Light Purple"
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "6 = Yellow E = Yellow"
Else
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "5 = ??? D = ???"
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "6 = ??? E = ???"
End If
If Strings.AvailableFeature(10) = "1" Then
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "7 = Dark Gray F = White"
Else
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "7 = ??? F = White"
End If
End Sub
Public Sub GetColor(App As String, Bg As String, Fg As String)
Select Case App
Case "terminal"
BgColor = Color.Black
FgColor = Color.White
Case "infobar"
BgColor = Color.White
FgColor = Color.Black
End Select
If Bg = Fg Then
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Background and Foreground Color cannot be same!"
Else
If Strings.AvailableFeature(10) = "1" Then
Select Case Bg
Case "0"
BgColor = Color.Black
Case "7"
BgColor = Color.Silver
Case "8"
BgColor = Color.Gray
Case "f"
BgColor = Color.White
Case "2", "9", "c"
If Strings.AvailableFeature(13) = "1" Then
Select Case Bg
Case "2"
BgColor = Color.Green
Case "9"
BgColor = Color.Blue
Case "c"
BgColor = Color.Red
End Select
Else
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "One or two colors you selected is not available."
End If
Case "1", "4", "a"
If Strings.AvailableFeature(14) = "1" Then
Select Case Bg
Case "1"
BgColor = Color.Navy
Case "4"
BgColor = Color.Maroon
Case "a"
BgColor = Color.Lime
End Select
Else
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "One or two colors you selected is not available."
End If
Case "3", "5", "6", "b", "d", "e"
If Strings.AvailableFeature(15) = "1" Then
Select Case Bg
Case "3"
BgColor = Color.Cyan
Case "5"
BgColor = Color.Magenta
Case "6"
BgColor = Color.Brown
Case "b"
BgColor = Color.Aqua
Case "d"
BgColor = Color.Fuchsia
Case "e"
BgColor = Color.Yellow
End Select
Else
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "One or two colors you selected is not available."
End If
Case Else
BgColor = Color.Black
End Select
Select Case Fg
Case "0"
FgColor = Color.Black
Case "7"
FgColor = Color.Silver
Case "8"
FgColor = Color.Gray
Case "f"
FgColor = Color.White
Case "2", "9", "c"
If Strings.AvailableFeature(13) = "1" Then
Select Case Fg
Case "2"
FgColor = Color.Green
Case "9"
FgColor = Color.Blue
Case "c"
FgColor = Color.Red
End Select
Else
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "One or two colors you selected is not available."
End If
Case "1", "4", "a"
If Strings.AvailableFeature(14) = "1" Then
Select Case Fg
Case "1"
FgColor = Color.Navy
Case "4"
FgColor = Color.Maroon
Case "a"
FgColor = Color.Lime
End Select
Else
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "One or two colors you selected is not available."
End If
Case "3", "5", "6", "b", "d", "e"
If Strings.AvailableFeature(15) = "1" Then
Select Case Fg
Case "3"
FgColor = Color.Cyan
Case "5"
FgColor = Color.Magenta
Case "6"
FgColor = Color.Brown
Case "b"
FgColor = Color.Aqua
Case "d"
FgColor = Color.Fuchsia
Case "e"
FgColor = Color.Yellow
End Select
Else
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "One or two colors you selected is not available."
End If
Case Else
FgColor = Color.White
End Select
Else
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Color is not supported for 1-bit Color Display"
Select Case App
Case "terminal"
BgColor = Color.Black
FgColor = Color.White
Case "infobar"
BgColor = Color.White
FgColor = Color.Black
End Select
End If
End If
Select Case App
Case "infobar"
Terminal.InfoBar.BackColor = BgColor
Terminal.InfoBar.ForeColor = FgColor
Case "terminal"
Terminal.TextBox1.BackColor = BgColor
Terminal.TextBox1.ForeColor = FgColor
Strings.OnceInfo(3) = Bg & Fg
End Select
End Sub
End Module
|