Sha256: e0dbae65a1f23bc1424524e3554274cb246fe57aeb6d26d70677048c6a3c3c35
Contents?: true
Size: 665 Bytes
Versions: 2
Compression:
Stored size: 665 Bytes
Contents
# frozen_string_literal: true 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
git-crecord-1.1.1 | lib/git_crecord/ui/color.rb |
git-crecord-1.1.0 | lib/git_crecord/ui/color.rb |