Working with Ruby by Jan Lelis

Building yet another terminal colors gem: term-ansicolor meets rainbow

There are plenty terminal color gems out there. Now, there is one more. Why?

What’s out there?

I’ve found about 14 miscellaneous ansi color string libraries with some quick searches on github and rubygems. However, about eight of them where using string extensions. This is not really suitable for library development.

The most interesting (and popular) ones are rainbow, which supports 256-color terminals, and term-ansicolor, which can be used very flexible without forcing string extensions. HighLine is another nice gem that’s capable of terminal colors, but it’s just a little part of something that maybe can be described as a “console io framework”.

My design goals

  • Should not use string extensions by default
  • Should support 256 colors
  • Should have a consistent api that is easy to use
  • Should allow applying multiple effects via one escape sequence, not by nesting (so red and bold is \e[31;1m not \e[31m\e[1m)
  • Should provide a way to define custom color names (this also allows to get compatible with gems that use “wrong” color names, e.g. Wirb and Wirble)
  • Should support setting any escape sequences, even if the current terminal does not support it
  • Should stay as thin as possible


See the results at ;)

Creative Commons License


buy sunglasses online uk | May 05, 2015

Baby value, love ah! Too fond of, no color, feels very good, is what I always wanted pack, I did not expect so cheap to buy such a good thing, although the shipping and delivery a bit slow, but does not affect Ha, love it! Favorite quickly start it!
buy sunglasses online uk

reading sunglasses uk | May 06, 2015

Good style, very nice atmosphere, colleagues say good-looking, satisfied
reading sunglasses uk

buy designer sunglasses | May 07, 2015

Packaging is very good, good quality, good-looking, no color, the seller good attitude, express to the force, will continue to focus on the
buy designer sunglasses

ray ban glasses | May 08, 2015

The bag is very good, very beautiful, feels very comfortable, the quality is very good, the boss also good, a praise
ray ban glasses

ray ban glasses | May 09, 2015

Package good. Is genuine. Very good very like colors and styles. Back a grade.. Express soon. Thank the seller for patient explanation. Good service attitude.
ray ban glasses

ray ban glasses | May 10, 2015

Bag is very good, the best choice in the summer, sort just good! Bright colors! Purple faint liked na! When I purchased the contrast for a long time, this now online ninety absolutely not the same as buying the right
ray ban glasses

ray ban glasses cheap uk | May 11, 2015

Baby received today, open on see is very surprised, very grade, unable to hold oneself back to daily necessities are placed inside, baby space is very large, can put a lot of things, carrying up a grade. The cortex is very good, feels very comfortable, very worth buying a bag. The seller who is also very good.
ray ban glasses cheap uk

reading sunglasses uk | May 12, 2015

Baby is very good, open the package when received a very pleasant surprise, better than imagined, the seller provides a good service, really like this one ~ out
reading sunglasses uk

ray ban glasses | May 13, 2015

Bag of good quality, color, no color difference, work is also very careful, just the right size, fashionable and stylish, the chain quality is also very good, and the description of the agreement, this price can buy quality is so good bag, value, the seller is very nice, patient and meticulous, thoughtful service, delivery fast also, next time will come again, praise.
ray ban glasses

reading sunglasses uk | May 15, 2015

The bag is very good, also took the fashion, logistics fast, received after the baby is really very good, like the seller described, quality super rods, sellers are really carefully packed tight. It was very thoughtful of the. Everyone deserves to visit. The next time I have to this shop.
reading sunglasses uk

buy sunglasses online uk | May 17, 2015

The bag is good, the fabric is soft, comfortable, I like it very much. Really value. The color is my favorite, the store is responsible, packaging is very good. Logistics is also very impressive, even gave a small card bag, packed bus card good
buy sunglasses online uk

ray ban glasses | May 19, 2015

The bag to receive service attitude is very high high quality and inexpensive sellers price very good delivery fast logistics awesome.
ray ban glasses

cheap sunglasses uk | May 19, 2015

The bag is very beautiful, just like in the entity saw good workmanship is very fine leather, determined to be authentic bags,
cheap sunglasses uk

ray ban glasses | May 20, 2015

The bag is too beautiful, and photos, no color difference, color, good quality, version type bag is also very like. The husband also said super value to buy, after all in your home to buy a bag. The seller also service attitude is super good sent card bag pink also like..
ray ban glasses

designer sunglasses | May 21, 2015

The bag is very nice, but the store sent the wrong color, red to black, but my sister liked, say very atmosphere, the seller attitude is also very good, logistics is also fast, very value.
designer sunglasses

mens sunglasses | May 22, 2015

Style is tidal, workmanship is very great! The price is high, the color is also very good, the overall feeling pretty good, the size is very positive, no taste, the zipper is good, fine workmanship, a shopping is very good!
mens sunglasses

ray ban sunglasses outlet | May 31, 2015

Get the you want after browsing our collection of in our store. A large number of products in stock now. Delivery and returns are always free.
<a href="" >ray ban sunglasses outlet</a> [url=]ray ban sunglasses outlet[/url]

You? | June 02, 2015