Misc cleanup.

This commit is contained in:
Neil Fraser
2016-11-05 00:15:39 -07:00
parent 917b8ff542
commit 5b033e2f7b
10 changed files with 21 additions and 19 deletions

View File

@@ -631,7 +631,7 @@ Blockly.Block.prototype.getColour = function() {
* @param {number|string} colour HSV hue value, or #RRGGBB string.
*/
Blockly.Block.prototype.setColour = function(colour) {
var hue = parseFloat(colour);
var hue = Number(colour);
if (!isNaN(hue)) {
this.colour_ = Blockly.hueToRgb(hue);
} else if (goog.isString(colour) && colour.match(/^#[0-9a-fA-F]{6}$/)) {