Class: AnsiArt::Converter

Inherits:
Object
  • Object
show all
Defined in:
lib/ansi_art/converter.rb

Direct Known Subclasses

HtmlConverter, PngConverter

Instance Method Summary collapse

Constructor Details

#initializeConverter

Returns a new instance of Converter.



3
4
5
# File 'lib/ansi_art/converter.rb', line 3

def initialize
  reset_color
end

Instance Method Details

#commit_colorObject



18
19
20
# File 'lib/ansi_art/converter.rb', line 18

def commit_color
  #this is when new color is ACKed, do nothing by default
end

#outputObject

this is when new color is ACKed, do nothing by default



21
22
# File 'lib/ansi_art/converter.rb', line 21

def output
end

#reset_colorObject



15
16
17
# File 'lib/ansi_art/converter.rb', line 15

def reset_color
  set_color 7,0,false
end

#set_color(fg, bg, bri) ⇒ Object



9
10
11
# File 'lib/ansi_art/converter.rb', line 9

def set_color fg,bg,bri
  @color = {:fg => fg, :bg => bg, :bri => bri}
end

#set_color_for(key, color) ⇒ Object



12
13
14
# File 'lib/ansi_art/converter.rb', line 12

def set_color_for key,color
  @color[key] = color
end

#wait_half_char!Object

store dual color char left side color



6
7
8
# File 'lib/ansi_art/converter.rb', line 6

def wait_half_char! # store dual color char left side color
  @leftColor = @color.clone
end