...
1 package colorful
2
3 import (
4 "math/rand"
5 )
6
7
8
9
10 func FastHappyPalette(colorsCount int) (colors []Color) {
11 colors = make([]Color, colorsCount)
12
13 for i := 0; i < colorsCount; i++ {
14 colors[i] = Hsv(float64(i)*(360.0/float64(colorsCount)), 0.8+rand.Float64()*0.2, 0.65+rand.Float64()*0.2)
15 }
16 return
17 }
18
19 func HappyPalette(colorsCount int) ([]Color, error) {
20 pimpy := func(l, a, b float64) bool {
21 _, c, _ := LabToHcl(l, a, b)
22 return 0.3 <= c && 0.4 <= l && l <= 0.8
23 }
24 return SoftPaletteEx(colorsCount, SoftPaletteSettings{pimpy, 50, true})
25 }
26
View as plain text