Class: TTYHue::TermColor::Gui

Inherits:
Base
  • Object
show all
Defined in:
lib/ttyhue/term_color.rb

Instance Method Summary collapse

Methods inherited from Base

#inspect

Constructor Details

#initialize(code) ⇒ Gui

Returns a new instance of Gui.



63
64
65
# File 'lib/ttyhue/term_color.rb', line 63

def initialize(code)
  @code = code
end

Instance Method Details

#color_nameObject



67
68
69
# File 'lib/ttyhue/term_color.rb', line 67

def color_name
  "gui_#{@code}".to_sym
end

#tag_nameObject



71
72
73
# File 'lib/ttyhue/term_color.rb', line 71

def tag_name
  "gui#{@code.to_s}"
end

#term_hex(bg) ⇒ Object



75
76
77
78
# File 'lib/ttyhue/term_color.rb', line 75

def term_hex(bg)
  prefix = bg ? "48;5;" : "38;5;"
  prefix + @code.to_s
end