Module: SuperDiff::Csi::ColorHelper

Defined in:
lib/super_diff/csi/color_helper.rb

Constant Summary collapse

BLACK =
Csi::FourBitColor.new(:white)
LIGHT_RED =

LIGHT_RED = Csi::TwentyFourBitColor.new(r: 63, g: 32, b: 32)

Csi::TwentyFourBitColor.new(r: 73, g: 62, b: 71)
RED =

RED = Csi::TwentyFourBitColor.new(r: 110, g: 56, b: 56) RED = Csi::TwentyFourBitColor.new(r: 116, g: 78, b: 84)

Csi::FourBitColor.new(:red)
LIGHT_GREEN =

LIGHT_GREEN = Csi::TwentyFourBitColor.new(r: 40, g: 48, b: 39)

Csi::TwentyFourBitColor.new(r: 51, g: 81, b: 81)
GREEN =

GREEN = Csi::TwentyFourBitColor.new(r: 73, g: 87, b: 71) GREEN = Csi::TwentyFourBitColor.new(r: 81, g: 115, b: 105)

Csi::FourBitColor.new(:green)
DARK_GREY =
Csi::TwentyFourBitColor.new(r: 134, g: 147, b: 149)

Class Method Summary collapse

Class Method Details

.dark_grey(text) ⇒ Object



47
48
49
# File 'lib/super_diff/csi/color_helper.rb', line 47

def self.dark_grey(text)
  Csi.colorize(text, fg: BLACK, bg: DARK_GREY)
end

.green(text) ⇒ Object



43
44
45
# File 'lib/super_diff/csi/color_helper.rb', line 43

def self.green(text)
  Csi.colorize(text, fg: GREEN)
end

.light_green_bg(text) ⇒ Object



39
40
41
# File 'lib/super_diff/csi/color_helper.rb', line 39

def self.light_green_bg(text)
  Csi.colorize(text, fg: BLACK, bg: LIGHT_GREEN)
end

.light_red_bg(text) ⇒ Object



31
32
33
# File 'lib/super_diff/csi/color_helper.rb', line 31

def self.light_red_bg(text)
  Csi.colorize(text, fg: BLACK, bg: LIGHT_RED)
end

.line(given_text = "") ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/super_diff/csi/color_helper.rb', line 21

def self.line(given_text = "")
  if block_given?
    text = ""
    yield text
    text + "\n"
  else
    given_text + "\n"
  end
end

.plain(text) ⇒ Object



17
18
19
# File 'lib/super_diff/csi/color_helper.rb', line 17

def self.plain(text)
  text
end

.red(text) ⇒ Object



35
36
37
# File 'lib/super_diff/csi/color_helper.rb', line 35

def self.red(text)
  Csi.colorize(text, fg: RED)
end