components/blockly-src/blocks/colour.js
function() {
    this.jsonInit({
      "message0": "%1",
      "args0": [
        {
          "type": "field_colour",
          "name": "COLOUR",
          "colour": "#ff0000"
        }
      ],
      "output": "Colour",
      "colour": Blockly.Blocks.colour.HUE,
      "helpUrl": Blockly.Msg.COLOUR_PICKER_HELPURL
    });
    // Assign 'this' to a variable for use in the tooltip closure below.
    var thisBlock = this;
    // Colour block is trivial.  Use tooltip of parent block if it exists.
    this.setTooltip(function() {
      var parent = thisBlock.getParent();
      return (parent && parent.tooltip) || Blockly.Msg.COLOUR_PICKER_TOOLTIP;
    });
  }
function() {
    this.jsonInit({
      "message0": "%1",
      "args0": [
        {
          "type": "field_colour",
          "name": "COLOUR",
          "colour": "#ff0000"
        }
      ],
      "output": "Colour",
      "colour": Blockly.Blocks.colour.HUE,
      "helpUrl": Blockly.Msg.COLOUR_PICKER_HELPURL
    });
    // Assign 'this' to a variable for use in the tooltip closure below.
    var thisBlock = this;
    // Colour block is trivial.  Use tooltip of parent block if it exists.
    this.setTooltip(function() {
      var parent = thisBlock.getParent();
      return (parent && parent.tooltip) || Blockly.Msg.COLOUR_PICKER_TOOLTIP;
    });
  }
function ( ) { this . jsonInit ( { "message0" : "%1" , "args0" : [ { "type" : "field_colour" , "name" : "COLOUR" , "colour" : "#ff0000" } ] , "output" : "Colour" , "colour" : Blockly . Blocks . colour . HUE , "helpUrl" : Blockly . Msg . COLOUR_PICKER_HELPURL } ) ; // Assign 'this' to a variable for use in the tooltip closure below. var thisBlock = this ; // Colour block is trivial.  Use tooltip of parent block if it exists. this . setTooltip ( function ( ) { var parent = thisBlock . getParent ( ) ; return ( parent && parent . tooltip ) || Blockly . Msg . COLOUR_PICKER_TOOLTIP ; } ) ; }
Block for colour picker.
@this Blockly.Block
Block for colour picker .