Skip to content

Instantly share code, notes, and snippets.

@myun2
Last active December 30, 2020 19:05
Show Gist options
  • Save myun2/e69694e7647ab153e0d3e1ebc29561db to your computer and use it in GitHub Desktop.
Save myun2/e69694e7647ab153e0d3e1ebc29561db to your computer and use it in GitHub Desktop.
(0..15).each do |i|
print "\e[38;5;#{i}m#{"%3d" % i}\u2588 "
puts "" if i % 8 == 7
end
puts ""
(16..231).each do |i|
print "\e[38;5;#{i}m#{"%3d" % i}\u2588 "
puts "" if (i - 16) % 6 == 5
end
puts ""
(232..255).each do |i|
print "\e[38;5;#{i}m#{"%3d" % i}\u2588 "
puts "" if (i - 232) % 12 == 11
end
(0..15).each do |r|
(0..7).each do |g|
(0..7).each do |b|
print "\e[38;2;#{r*16};#{g*32};#{b*32}m\u2588"
end
end
puts ""
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment