libfic: Create a color randomization function

This commit is contained in:
nemunaire 2025-03-25 18:54:36 +01:00
commit 590a55c395
2 changed files with 11 additions and 7 deletions

View file

@ -3,6 +3,7 @@ package fic
import (
"bytes"
"crypto/md5"
"math/rand"
"regexp"
"strings"
)
@ -187,3 +188,11 @@ func (c HSL) ToRGB() (rgb uint32) {
return r*65536 + g*256 + b
}
func RandomColor() HSL {
return HSL{
H: rand.Float64(),
S: 1,
L: 0.5,
}
}