module Regnbue
Defined in:
regnbue.crregnbue/version.cr
Constant Summary
-
COLOR_REGEX =
/\e\[\d\d?m/
-
VERSION =
"0.1.0"
Class Method Summary
-
.format_large_number(number, separator : String = ",")
Regnbue.format_large_number(1234567) #=> "1,234,567"
- .uncolor(str : String)
Macro Summary
-
format_string(tuple)
Takes a tuple of the form: {color, arg1, arg2, **args } where arg1, arg2, ...
Class Method Detail
def self.format_large_number(number, separator : String = ",")
#
Regnbue.format_large_number(1234567) #=> "1,234,567"
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.