Sha256: 459305476d0c1b60b582a14c629f38cc94bed21300ad1024b30dc5f05656525c
Contents?: true
Size: 633 Bytes
Versions: 1
Compression:
Stored size: 633 Bytes
Contents
require 'curses' module GitCrecord module UI module Color MAP = { normal: 1, green: 2, red: 3, hl: 4 }.freeze def self.init Curses.start_color Curses.use_default_colors Curses.init_pair(MAP[:normal], -1, -1) Curses.init_pair(MAP[:green], Curses::COLOR_GREEN, -1) Curses.init_pair(MAP[:red], Curses::COLOR_RED, -1) Curses.init_pair(MAP[:hl], Curses::COLOR_BLACK, Curses::COLOR_GREEN) end MAP.each_pair do |name, number| define_singleton_method(name){ Curses.color_pair(number) } end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
git-crecord-1.0.8 | lib/git_crecord/ui/color.rb |