{"id":51,"date":"2012-04-25T19:18:40","date_gmt":"2012-04-26T00:18:40","guid":{"rendered":"http:\/\/www.playwithlua.com\/?p=51"},"modified":"2012-04-25T19:18:40","modified_gmt":"2012-04-26T00:18:40","slug":"colored-text-in-lua","status":"publish","type":"post","link":"http:\/\/www.playwithlua.com\/?p=51","title":{"rendered":"Colored text in Lua"},"content":{"rendered":"<p>If you, like me, are writing a text-mode Roguelike game in Lua, you&#8217;ll probably be interested in the <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/github.com\/randrews\/color');\"  href=\"http:\/\/github.com\/randrews\/color\">thing I just published<\/a>: a small Lua library for coloring text output to the console.<\/p>\n<p>It lets you do things like this:<\/p>\n\n<div class=\"my_syntax_box\"><div class=\"my_syntax\"><div class=\"code\"><pre class=\"lua\" style=\"font-family:monospace;\"><span style=\"color: #0000aa;\">print<\/span><span style=\"color: #66cc66;\">&#40;<\/span>color<span style=\"color: #66cc66;\">.<\/span>bg<span style=\"color: #66cc66;\">.<\/span>green <span style=\"color: #66cc66;\">..<\/span> color<span style=\"color: #66cc66;\">.<\/span>fg<span style=\"color: #66cc66;\">.<\/span>RED <span style=\"color: #66cc66;\">..<\/span> <span style=\"color: #ff6666;\">&quot;This is bright red on green&quot;<\/span><span style=\"color: #66cc66;\">&#41;<\/span><\/pre><\/div><\/div><\/div>\n\n<p>Couldn&#8217;t be simpler. Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you, like me, are writing a text-mode Roguelike game in Lua, you&#8217;ll probably be interested in the thing I just published: a small Lua library for coloring text output to the console. It lets you do things like this: print&#40;color.bg.green .. color.fg.RED .. &quot;This is bright red on green&quot;&#41; Couldn&#8217;t be simpler. Enjoy!<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/www.playwithlua.com\/index.php?rest_route=\/wp\/v2\/posts\/51"}],"collection":[{"href":"http:\/\/www.playwithlua.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.playwithlua.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.playwithlua.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.playwithlua.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=51"}],"version-history":[{"count":0,"href":"http:\/\/www.playwithlua.com\/index.php?rest_route=\/wp\/v2\/posts\/51\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.playwithlua.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.playwithlua.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.playwithlua.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}