 
   pixelBuffer: null
   charBuffer: null
-  colorBuffer: null
+  foregroundBuffer: null
+  backgroundBuffer: null
 
-  termReset: "\x1B[39m"
-  termColor: (color) -> "\x1B[38;5;#{color}m"
+  termReset: "\x1B[39;49m"
 
   constructor: (@width, @height) ->
     @pixelBuffer = new Buffer @width*@height/8

  clear: ->
    @pixelBuffer.fill 0
    @charBuffer = []
    @colorBuffer = []

  setPixel: (x, y, color) ->
    @_locate x, y, (idx, mask) =>
      @pixelBuffer[idx] |= mask
      @colorBuffer[idx] = @termColor color

  unsetPixel: (x, y) ->
    @_locate x, y, (idx, mask) =>

    for idx in [0...@pixelBuffer.length]
      output.push delimeter unless idx % (@width/2)

      if currentColor isnt colorCode = @_termColor @foregroundBuffer[idx], @backgroundBuffer[idx]
        output.push currentColor = colorCode

      output.push if @charBuffer[idx]
