Class: Pixel

Inherits:
Object
  • Object
show all
Defined in:
lib/console_splash/pixel.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(char = ' ', fcolor = :white, bcolor = nil) ⇒ Pixel

Returns a new instance of Pixel.



10
11
12
13
14
# File 'lib/console_splash/pixel.rb', line 10

def initialize( char=' ', fcolor=:white, bcolor=nil )
  @char = char
  @fcolor = fcolor
  @bcolor = bcolor
end

Instance Attribute Details

#bcolorObject

Returns the value of attribute bcolor.



8
9
10
# File 'lib/console_splash/pixel.rb', line 8

def bcolor
  @bcolor
end

#charObject

Returns the value of attribute char.



8
9
10
# File 'lib/console_splash/pixel.rb', line 8

def char
  @char
end

#fcolorObject

Returns the value of attribute fcolor.



8
9
10
# File 'lib/console_splash/pixel.rb', line 8

def fcolor
  @fcolor
end

Instance Method Details



16
17
18
# File 'lib/console_splash/pixel.rb', line 16

def print_pixel
  print char.colorize( :color => fcolor, :background => bcolor )
end