Module: ITT

Defined in:
lib/itt.rb

Constant Summary collapse

VERSION =
'0.1.5'
COLORS =

Predefined colors, as close to the default iTerm2 tab colors as possible

{
  red: [214, 110, 107],
  green: [183, 213, 103],
  blue: [117, 165, 236],
  orange: [223, 157, 78],
  yellow: [167, 160, 96],
  purple: [140, 121, 149]
}
HELP =

Help info

''

Instance Method Summary collapse

Instance Method Details

#clear_colorObject

Escape sequences to clear the title and color



38
39
40
# File 'lib/itt.rb', line 38

def clear_color
  "\e]6;1;bg;*;default\a"
end

#clear_titleObject



42
43
44
# File 'lib/itt.rb', line 42

def clear_title
  "\e]1;\a"
end

#set_color(red, green, blue) ⇒ Object

Escape sequences to set the color



30
31
32
33
34
35
# File 'lib/itt.rb', line 30

def set_color(red, green, blue)
  output = ''
  output << "\e]6;1;bg;red;brightness;#{red}\a"
  output << "\e]6;1;bg;green;brightness;#{green}\a"
  output << "\e]6;1;bg;blue;brightness;#{blue}\a"
end

#set_title(title) ⇒ Object

Escape sequence to set the title



25
26
27
# File 'lib/itt.rb', line 25

def set_title(title)
  "\e];#{title}\007"
end