fic: Pick HSL function to generate random colors

This commit is contained in:
nemunaire 2021-09-04 20:51:30 +02:00
parent 6395eaaf5f
commit 63de5d64b1
3 changed files with 60 additions and 1 deletions

View file

@ -82,7 +82,7 @@ func treatRegistration(pathname string, team_id string) {
} else if denyTeamCreation {
log.Printf("%s [ERR] Registration received, whereas team creation denied. Skipped.\n", id)
} else if validTeamName(nTeam.TeamName) {
if team, err := fic.CreateTeam(nTeam.TeamName, uint32(rand.Int31n(16581376))); err != nil {
if team, err := fic.CreateTeam(nTeam.TeamName, fic.HSL{H: rand.Float64(), L: 1, S: 0.5}.ToRGB(), ""); err != nil {
log.Printf("%s [ERR] Unable to register new team %s: %s\n", id, nTeam.TeamName, err)
} else {
registrationProcess(id, team, nTeam.Members, team_id)