Closed
Description
Many terminals today support true color with ANSI escape sequences.
Here's an example:
puts "\e[38;2;100;255;100mI'm green\e[0m"
This would colour the text in a nice bright green color:
Another example:
puts "\e[48;2;100;50;30mMy background is brown like wood\e[0m"
This would colour the background brown:
We can colour our texts in exactly 16777216 colors!
Heres a rainbow:
loop do
print "\r\e[38;2;#{rand(0..255)};#{rand(0..255)};#{rand(0..255)}mI am a rainbow\e[0m"
sleep 0.1
end
Right now Colorize doesn't supports any other colors than these:
black
red
green
yellow
blue
magenta
cyan
light_gray
dark_gray
light_red
light_green
light_yellow
light_blue
light_magenta
light_cyan
white
Having 16777200 more colors than this would be a good feature I think.
Metadata
Metadata
Assignees
Labels
No labels