libfic: Create a color randomization function
This commit is contained in:
parent
b62369f89f
commit
590a55c395
2 changed files with 11 additions and 7 deletions
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue