       pixels = context.getImageData(0, 0, canvas.width, canvas.height).data
       pixelCount = canvas.width*canvas.height
       try
-        colors = thief.getPaletteFromPixels pixels, pixelCount, 10, 10
+        colors = thief.getPaletteFromPixels pixels, pixelCount, @colors, @quality
         if @outputCssColors
           colors = colors.map (color) -> "rgb(#{color[0]}, #{color[1]}, #{color[2]})"
       catch e


    @inPorts.css.on 'data', (boo) =>
      @outputCssColors = boo

exports.getComponent = -> new GetColors

  constructor: ->

    @outputCssColors = false
    @quality = 10
    @colors = 10

    @inPorts = new noflo.InPorts
      canvas:
        datatype: 'object'
      css:
        datatype: 'boolean'
      colors:
        datatype: 'number'
        default: 10
      quality:
        datatype: 'number'
        default: 10
    @outPorts =
      colors: new noflo.Port 'array'
      canvas: new noflo.Port 'object'
