mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Use random colour from Blockly generator (#491)
This commit is contained in:
parent
320cc21434
commit
8f35b67ba1
1 changed files with 2 additions and 1 deletions
|
@ -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'] = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue