Use random colour from Blockly generator (#491)

This commit is contained in:
Tim Mickel 2016-07-07 11:45:34 -04:00 committed by GitHub
commit 8f35b67ba1

View file

@ -35,7 +35,8 @@ goog.require('Blockly.constants');
* @return {!string} #RRGGBB for random colour.
*/
function randomColour() {
return '#' + Math.floor(Math.random() * 16777215).toString(16);
var num = Math.floor(Math.random() * Math.pow(2, 24));
return '#' + ('00000' + num.toString(16)).substr(-6);
}
Blockly.Blocks['colour_picker'] = {