Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] createTeam color improvement #2

Closed
alopezlago opened this issue Oct 9, 2020 · 1 comment
Closed

[Suggestion] createTeam color improvement #2

alopezlago opened this issue Oct 9, 2020 · 1 comment

Comments

@alopezlago
Copy link

In team.js, createTeam will pick random colors between a range in a while loop. The downsides to this approach are:

  • Can theoretically run forever (though practically impossible)
  • Can pick the same color for two different teams, or colors that are near indistinguishable

Consider one of these approaches:

  • Store an array of all the colors you want to use, then pick one based on the team index (either passed in, or tracked by a variable in the file)
  • Have a baseline color (like <48, 48, 48>). Figure out how large the steps between color can be (there should be a maximum team size, since Discord only lets you have 500 channels per server). Treat the array like a set of digits, and keep increasing it until you reach the lightest color. Then, go back to your baseline color, and start again. For example, if your step size is 20, the colors would be <48, 48, 48>, <48, 48, 68>, ..., <48, 48, 248>, <48, 68, 48>, ...
    • Then, you can either pass in the team index, or track it in the file.
@alchzh
Copy link
Owner

alchzh commented Oct 9, 2020

I could pre-define an attractive set of colors and then iterate through them, though there would still be repeating across different brackets ( / team ranges). do you think that would be okay?

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

No branches or pull requests

2 participants