     for idx in [0...@pixelBuffer.length]
       output.push delimeter unless idx % (@width/2)
 
-      if currentColor isnt colorCode = @colorBuffer[idx] or @termReset
+      if currentColor isnt colorCode = @_termColor @foregroundBuffer[idx], @backgroundBuffer[idx]
         output.push currentColor = colorCode
 
       output.push if @charBuffer[idx]

    mask = @characterMap[y&3][x&1]
    cb idx, mask

  frame: ->
    output = []
    currentColor = null


  pixelBuffer: null
  charBuffer: null
  foregroundBuffer: null
  backgroundBuffer: null

  termReset: "\x1B[39;49m"

  constructor: (@width, @height) ->
    @pixelBuffer = new Buffer @width*@height/8
