function PipetteTool(toolContext, callback) {
    /**
     * @type {HTMLCanvasElement}
     */
    this.sourceCanvas = toolContext.sourceCanvas;

    /**
     * @type {CanvasRenderingContext2D}
     */
    this.sourceContext = Canvas2DContext(toolContext.sourceCanvas);

    /**
     * Called when color is selected.
     * The parameters are the color, the opacity value of the color
     * and whether the mouse has finished moving.
     * Opacity is a value in [0,1].
     * @type {function(string, number)}
     */
    this.callback = callback;

    /**
     * The selected color.
     * @type {string}
     */
    this.pipetteColor = 'rgb(0, 0, 0)';

    /**
     * The opacity value of the selected color.
     * @type {number}
     */
    this.opacity = 100;

    /**
     * Whether the mouse is being held down for a drag.
     * @type {boolean}
     */
    this.dragging = false;

    /**
     * Pipette cursor image.
     * @type {Element}
     */
    this.pipetteCursorDiv = document.createElement('div');
    this.pipetteCursorDiv.style.width = PIPETTE_CURSOR_SIZE + 'px';
    this.pipetteCursorDiv.style.height = PIPETTE_CURSOR_SIZE + 'px';
    this.pipetteCursorDiv.style.backgroundImage =
        'url("images/pipette_cursor.png")';

  }
/**
   * Pipette tool. Gets the color of the selected pixel on the
   * display canvas and puts it on the color palette.
   * @constructor
   * @struct
   * @implements {Tool}
   * @param {ToolContext} toolContext
   * @param {function(string, number)} callback
   */
Pipette tool. Gets the color of the selected pixel on the
display canvas and puts it on the color palette.
Pipette tool . Gets the color of the selected pixel on the display canvas and puts it on the color palette .
function PipetteTool(toolContext, callback) {
    this.sourceCanvas = toolContext.sourceCanvas;
    this.sourceContext = Canvas2DContext(toolContext.sourceCanvas);
    this.callback = callback;
    this.pipetteColor = 'rgb(0, 0, 0)';
    this.opacity = 100;
    this.dragging = false;
    this.pipetteCursorDiv = document.createElement('div');
    this.pipetteCursorDiv.style.width = PIPETTE_CURSOR_SIZE + 'px';
    this.pipetteCursorDiv.style.height = PIPETTE_CURSOR_SIZE + 'px';
    this.pipetteCursorDiv.style.backgroundImage =
        'url("images/pipette_cursor.png")';
  }
function PipetteTool ( toolContext , callback ) { this . sourceCanvas = toolContext . sourceCanvas ; this . sourceContext = Canvas2DContext ( toolContext . sourceCanvas ) ; this . callback = callback ; this . pipetteColor = 'rgb(0, 0, 0)' ; this . opacity = 100 ; this . dragging = false ; this . pipetteCursorDiv = document . createElement ( 'div' ) ; this . pipetteCursorDiv . style . width = PIPETTE_CURSOR_SIZE + 'px' ; this . pipetteCursorDiv . style . height = PIPETTE_CURSOR_SIZE + 'px' ; this . pipetteCursorDiv . style . backgroundImage = 'url("images/pipette_cursor.png")' ; }
Pipette tool.
Pipette tool .
/**
     * @type {HTMLCanvasElement}
     */ /**
     * @type {CanvasRenderingContext2D}
     */ /**
     * Called when color is selected.
     * The parameters are the color, the opacity value of the color
     * and whether the mouse has finished moving.
     * Opacity is a value in [0,1].
     * @type {function(string, number)}
     */ /**
     * The selected color.
     * @type {string}
     */ /**
     * The opacity value of the selected color.
     * @type {number}
     */ /**
     * Whether the mouse is being held down for a drag.
     * @type {boolean}
     */ /**
     * Pipette cursor image.
     * @type {Element}
     */