Class: Chamomile::Color::ANSIColor

Inherits:
Data
  • Object
show all
Defined in:
lib/chamomile/styling/color.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code

Returns:

  • (Object)

    the current value of code



43
44
45
# File 'lib/chamomile/styling/color.rb', line 43

def code
  @code
end

Instance Method Details

#bg_sequenceObject



52
53
54
55
56
57
58
# File 'lib/chamomile/styling/color.rb', line 52

def bg_sequence
  if code < 8
    (40 + code).to_s
  else
    (100 + code - 8).to_s
  end
end

#fg_sequenceObject



44
45
46
47
48
49
50
# File 'lib/chamomile/styling/color.rb', line 44

def fg_sequence
  if code < 8
    (30 + code).to_s
  else
    (90 + code - 8).to_s
  end
end

#no_color?Boolean

Returns:

  • (Boolean)


60
# File 'lib/chamomile/styling/color.rb', line 60

def no_color? = false