I got moderately bored and moderately tired of not having any color in my Linux srcds terminal. So I wrote a pure-lua solution.
Before:
https://c2n.me/40xfSUY.png
After:
https://c2n.me/40xfgKe.png
ErrorNoHalt looks a bit differently and more badass:
https://c2n.me/40xeHPl.png
Code:
https://gist.github.com/Meow/4063429fb68a438883789fafa3d5be92
Installation:
Copy the code.
Create a file in lua/autorun/server
Paste the code into that file.
Note: this only fixes MsgC and ErrorNoHalt
I don't know if someone did anything similar before, at least not in pure Lua. So if someone did, then I'm an idiot, I guess.
As a little bonus, I made an extended version of this library that supports all 256 Linux terminal colors (if your terminal supports 256 colors), background colors, as well as style options (underlined, dimmed, blinking, etc).
Code:
https://gist.github.com/Meow/1d01470e4cfddcd45c83a9eec7615096
Installation is the same as the other library. This version has worse performance due to the amount of features it attempts to cover.
Usage (first color is foreground, second is background, all parameters are optional):
print_colored("text here\n", Color(255, 255, 255), Color(255, 0, 0), {
bold = false,
dim = false,
underline = false,
blink = false,
inverted = false,
hidden = false
})
Sorry, you need to Log In to post a reply to this thread.