Class: TTYHue::TermColor::Theme
Instance Method Summary collapse
- #color_name ⇒ Object
-
#initialize(label, light) ⇒ Theme
constructor
A new instance of Theme.
- #tag_name ⇒ Object
- #term_hex(bg) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(label, light) ⇒ Theme
Returns a new instance of Theme.
37 38 39 40 |
# File 'lib/ttyhue/term_color.rb', line 37 def initialize(label, light) @label = label @light = light end |
Instance Method Details
#color_name ⇒ Object
42 43 44 |
# File 'lib/ttyhue/term_color.rb', line 42 def color_name [('light' if @light), @label].compact.join("_").to_sym end |
#tag_name ⇒ Object
46 47 48 |
# File 'lib/ttyhue/term_color.rb', line 46 def tag_name [('l' if @light), @label].compact.join end |
#term_hex(bg) ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/ttyhue/term_color.rb', line 50 def term_hex(bg) color_index = TermColor::LABELS.index(@label) if @light bg ? "10#{color_index}" : "9#{color_index}" else bg ? "4#{color_index}" : "3#{color_index}" end end |