Sha256: e93e2e4a3cd5938e520af00963ac7d737a8911361177b2a88129ddc8f8845687
Contents?: true
Size: 450 Bytes
Versions: 4
Compression:
Stored size: 450 Bytes
Contents
require "curses" include Curses begin init_screen if !Curses.has_colors? addstr "This Terminal does not support colors!" else start_color addstr "This Terminal supports #{colors} colors.\n" Curses.colors.times { |i| Curses.init_pair(i, i, 0) attrset(color_pair(i)) addstr("#{i.to_s.rjust(3)} ") addstr("\n") if i == 15 || (i > 16 && (i - 15) % 36 == 0) } end getch ensure close_screen end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
curses-1.4.4 | sample/colors.rb |
curses-1.4.4.beta.1 | sample/colors.rb |
curses-1.4.3 | sample/colors.rb |
curses-1.4.2 | sample/colors.rb |