module Regnbue

Defined in:

regnbue.cr
regnbue/version.cr

Constant Summary

COLOR_REGEX = /\e\[\d\d?m/
VERSION = "0.1.0"

Class Method Summary

Macro Summary

Class Method Detail

def self.format_large_number(number, separator : String = ",") #

Regnbue.format_large_number(1234567) #=> "1,234,567"


[View source]
def self.uncolor(str : String) #

[View source]

Macro Detail

macro format_string(tuple) #

Takes a tuple of the form: {color, arg1, arg2, **args } where arg1, arg2, ... are either things that can be converted to a string or another tuple in the above format. So nesting of tuples is possible and also the main purpose. Nesting makes it possible to colorize portions of a text in a very simple way.


[View source]