Created
June 7, 2019 17:35
Revisions
-
DeoluA created this gist
Jun 7, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ var rand_hex_col_gen = function(){ // do the numbers first var options = []; for(var i=0; i<10; i++){ options.push(i.toString()); }; // add letters options = [].concat.apply(options, ["a", "b", "c", "d", "e", "f"]); // loop through till you get a col var chosen_col = "#"; while(chosen_col.length < 7){ chosen_col += options[Math.floor(Math.random() * options.length)] }; // return the final value return chosen_col; };