Module: Hab::Formatter::Colors
- Included in:
- Hab::Formatter
- Defined in:
- lib/hab/formatter/colors.rb
Constant Summary collapse
- VALUE_COLORS =
{ 5..10 => :light_blue, 1..5 => :light_green, -1..1 => :light_yellow, -5..-1 => :yellow, -10..-5 => :light_red }
- STAT_COLORS =
{ HP: :red, MP: :green, EXP: :yellow, DAILIES: :light_magenta, TODOS: :light_blue }
Instance Method Summary collapse
Instance Method Details
#stat_color(label) ⇒ Object
25 26 27 |
# File 'lib/hab/formatter/colors.rb', line 25 def stat_color(label) STAT_COLORS.key?(label) ? STAT_COLORS[label] : :default end |
#value_color(value) ⇒ Object
21 22 23 |
# File 'lib/hab/formatter/colors.rb', line 21 def value_color(value) VALUE_COLORS.select { |key, color| key.cover? value }.values.first end |