add Colorize

This commit is contained in:
Alexander Popov 2022-08-13 11:41:05 +03:00
parent 875be9645e
commit c01cbe5914
Signed by: iiiypuk
GPG Key ID: D8C9B59A9F04A70C
2 changed files with 25 additions and 0 deletions

24
~/Crystal/Colorize.cr Normal file
View File

@ -0,0 +1,24 @@
require "colorize"
"foo".colorize(:green)
100.colorize(:red)
[1, 2, 3].colorize(:blue)
# Available colors are:
# :default
# :black
# :red
# :green
# :yellow
# :blue
# :magenta
# :cyan
# :light_gray
# :dark_gray
# :light_red
# :light_green
# :light_yellow
# :light_blue
# :light_magenta
# :light_cyan
# :white

View File

@ -4,3 +4,4 @@
- [Значение из Regex::MatchData](value_from_match.cr) - Получить значение из `Regex::MatchData("Happy")`
- [IO::TimeoutError](prompt_timeout.cr) - Установка тайм-аута на пользовательский ввод
- [ENV["..."]](env_variable.cr) - Переменные среды
- [Colorize](Colorize.cr) - Цветной вывод в консоль