ansicolors.lua simplifies the handling of colors on the terminal in Lua.
It can be helpful to easily separate errors from non-errors, or just to spice up some loading log.
The library can be downloaded from here:
https://github.com/kikito/ansicolors.lua
ansicolors.lua isn't 100% mine; it's actually a fork of this other lib. I used string interpolations instead of literals and functions like him. I've also added some rudimentary check for windows, so windows users don't get garbage on their console (call it "graceful degradation", if you might).
Let me know if you find any bugs or have any feature requests for it.
Regards!
ansicolors.lua
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
ansicolors.lua
When I write def I mean function.
Re: ansicolors.lua
Sorry, but I don't see how this is related to LÖVE.
I'd suggest you post this to the Lua mailing list.
I'd suggest you post this to the Lua mailing list.
- ishkabible
- Party member
- Posts: 241
- Joined: Sat Oct 23, 2010 7:34 pm
- Location: Kansas USA
Re: ansicolors.lua
lol, shutdown. any way can you post some examples maybe?
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: ansicolors.lua
As pretty much all the libs I've released so far, it's a Lua library, and it can work independently from LÖVE.thelinx wrote:Sorry, but I don't see how this is related to LÖVE.
I'd suggest you post this to the Lua mailing list.
I realize that LÖVE's main interface is the LÖVE window, but the console is also there if you want to use it. So I guessed a little bling on that side wouldn't hurt.
Let me see if I can concoct something.ishkabible wrote:lol, shutdown. any way can you post some examples maybe?
When I write def I mean function.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: ansicolors.lua
Looks good mate! Reminds of that Richtext library that Robin had going.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: ansicolors.lua
Speaking of whom, I heard he also wrote a similar library/function, for a Lua text adventure game library. It has HTML-like tags, and is semantically rather than presentation oriented. For example: "You grab the <o>Sword of Ultimate Justice</o>.", "Type <c>help</c> to get some help." or "On your left is a door to <r>the cellar</r>." or things like that. (o for object, c for command, r for room, you get the idea.)BlackBulletIV wrote:Looks good mate! Reminds of that Richtext library that Robin had going.
Speaking of RichText, I really ought to update it or something. Write a decent word wrapping algorithm, for example.
Help us help you: attach a .love.
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Denver, CO
- Contact:
Re: ansicolors.lua
This is for your console output, not for things drawn to love.BlackBulletIV wrote:Looks good mate! Reminds of that Richtext library that Robin had going.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: ansicolors.lua
I assume he was thinking about the similar syntax.TechnoCat wrote:This is for your console output, not for things drawn to love.BlackBulletIV wrote:Looks good mate! Reminds of that Richtext library that Robin had going.
Non-Existing-God, I really need to work on RT again. I haven't even reviewed luminosity's patch!
Help us help you: attach a .love.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: ansicolors.lua
Are you speaking about yourself or kikito there? Either way, that sounds pretty cool.Robin wrote:Speaking of whom, I heard he also wrote a similar library/function, for a Lua text adventure game library. It has HTML-like tags, and is semantically rather than presentation oriented. For example: "You grab the <o>Sword of Ultimate Justice</o>.", "Type <c>help</c> to get some help." or "On your left is a door to <r>the cellar</r>." or things like that. (o for object, c for command, r for room, you get the idea.)BlackBulletIV wrote:Looks good mate! Reminds of that Richtext library that Robin had going.
Speaking of RichText, I really ought to update it or something. Write a decent word wrapping algorithm, for example.
I know that; I was referring to the syntax (as Robin said) and the general idea.TechnoCat wrote:This is for your console output, not for things drawn to love.BlackBulletIV wrote:Looks good mate! Reminds of that Richtext library that Robin had going.
-
- Prole
- Posts: 34
- Joined: Fri Sep 24, 2010 5:46 am
Re: ansicolors.lua
I'm just on the verge of having a look at the word wrapping in RT to try to fix up the problems it's got for me. Just as soon as I fix the few hundred timing errors I introduced when I fixed a bug in my event system :/Robin wrote:I assume he was thinking about the similar syntax.TechnoCat wrote:This is for your console output, not for things drawn to love.BlackBulletIV wrote:Looks good mate! Reminds of that Richtext library that Robin had going.
Non-Existing-God, I really need to work on RT again. I haven't even reviewed luminosity's patch!
Who is online
Users browsing this forum: Ahrefs [Bot] and 92 guests