Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

function getRandomHEXColor #238

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KL0maboi
Copy link

@KL0maboi KL0maboi commented Apr 9, 2022

adding getRandomHEXColor function to generate random hex codes

added `getRandomHEXColor` function to generate random hex codes
@KL0maboi
Copy link
Author

KL0maboi commented Apr 9, 2022

you can make this with modd.io scripts but its just long and pain this can finish it in just a function

@420kyle69
Copy link
Contributor

420kyle69 commented Apr 9, 2022

Cool stuff, but what would be the practical use of this? I think you should at least make it able to get a random hex code between a range of values, for example random color between #000020 and #0000FF (each third of the code would have its own range since hex color codes are three two-digit numbers together)

@420kyle69
Copy link
Contributor

Also:

returnValue = '#' + Math.floor(Math.random() * 0xffffff).toString(16).padStart(6, '0')

:trollface:

Plus, you're using a global variable i in your for loop (line 979), declare it with let instead

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants