diff options
| author | EverythingWindows <[email protected]> | 2022-11-14 13:50:43 +0700 |
|---|---|---|
| committer | EverythingWindows <[email protected]> | 2022-11-14 13:50:43 +0700 |
| commit | bd4c45f316d11e124fe5d21d9c5f66e21149fc5d (patch) | |
| tree | c9b1a4ad85f7d8c6b3cbe05f7769cb04f907dfa3 /ShiftOS-TheRevival/Functions/InGame/TerminalColorSystem.vb | |
| parent | b37a6e60c9ffa266fc1fc9afc13cada7704100b0 (diff) | |
| download | shiftos-therevival-old-bd4c45f316d11e124fe5d21d9c5f66e21149fc5d.tar.gz shiftos-therevival-old-bd4c45f316d11e124fe5d21d9c5f66e21149fc5d.tar.bz2 shiftos-therevival-old-bd4c45f316d11e124fe5d21d9c5f66e21149fc5d.zip | |
More organized
Diffstat (limited to 'ShiftOS-TheRevival/Functions/InGame/TerminalColorSystem.vb')
| -rw-r--r-- | ShiftOS-TheRevival/Functions/InGame/TerminalColorSystem.vb | 212 |
1 files changed, 212 insertions, 0 deletions
diff --git a/ShiftOS-TheRevival/Functions/InGame/TerminalColorSystem.vb b/ShiftOS-TheRevival/Functions/InGame/TerminalColorSystem.vb new file mode 100644 index 0000000..9042910 --- /dev/null +++ b/ShiftOS-TheRevival/Functions/InGame/TerminalColorSystem.vb @@ -0,0 +1,212 @@ +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() + NewLine("TERMINAL SUPPORTED COLORS") + NewLine(Nothing) + NewLine(Nothing) + If Strings.AvailableFeature(10) = "1" Then + NewLine("0 = Black 8 = Gray") + Else + NewLine("0 = Black 8 = ???") + End If + If Strings.AvailableFeature(14) = "1" Then + NewLine("1 = Blue 9 = Light Blue") + NewLine("2 = Green A = Light Green") + Else + If Strings.AvailableFeature(13) = "1" Then + NewLine("1 = ??? 9 = Light Blue") + NewLine("2 = Green A = ???") + Else + NewLine("1 = ??? 9 = ???") + NewLine("2 = ??? A = ???") + End If + End If + If Strings.AvailableFeature(15) = "1" Then + NewLine("3 = Aqua B = Light Aqua") + Else + NewLine("3 = ??? B = ???") + End If + If Strings.AvailableFeature(14) = "1" Then + NewLine("4 = Red C = Light Red") + ElseIf Strings.AvailableFeature(13) = "1" Then + NewLine("4 = ??? C = Light Red") + Else + NewLine("4 = ??? C = ???") + End If + If Strings.AvailableFeature(15) = "1" Then + NewLine("5 = Purple D = Light Purple") + NewLine("6 = Yellow E = Yellow") + Else + NewLine("5 = ??? D = ???") + NewLine("6 = ??? E = ???") + End If + If Strings.AvailableFeature(10) = "1" Then + NewLine("7 = Dark Gray F = White") + Else + 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 + 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 + 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 + 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 + 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 + 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 + 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 + NewLine("One or two colors you selected is not available.") + End If + Case Else + FgColor = Color.White + End Select + Else + 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" + Console.InfoBar.BackColor = BgColor + Console.InfoBar.ForeColor = FgColor + Strings.ComputerInfo(6) = Bg & Fg + Case "terminal" + Console.TextBox1.BackColor = BgColor + Console.TextBox1.ForeColor = FgColor + Strings.ComputerInfo(5) = Bg & Fg + End Select + End Sub +End Module |
