aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/lucasb-eyer/go-colorful/warm_palettegen.go
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-05-25 22:44:12 +0300
committerTulir Asokan <tulir@maunium.net>2018-05-25 22:44:12 +0300
commit7b8229dab12ddfe34b91a6eccce7744db17d398a (patch)
treeb569a2c085e2cbaab1975497500a1dd9001e7ba8 /vendor/github.com/lucasb-eyer/go-colorful/warm_palettegen.go
parenta76ce88a30e8c09603350a88827cf24239e8e44a (diff)
Update dependencies
Diffstat (limited to 'vendor/github.com/lucasb-eyer/go-colorful/warm_palettegen.go')
-rw-r--r--vendor/github.com/lucasb-eyer/go-colorful/warm_palettegen.go23
1 files changed, 11 insertions, 12 deletions
diff --git a/vendor/github.com/lucasb-eyer/go-colorful/warm_palettegen.go b/vendor/github.com/lucasb-eyer/go-colorful/warm_palettegen.go
index 18ff950..00f42a5 100644
--- a/vendor/github.com/lucasb-eyer/go-colorful/warm_palettegen.go
+++ b/vendor/github.com/lucasb-eyer/go-colorful/warm_palettegen.go
@@ -1,26 +1,25 @@
package colorful
import (
- "math/rand"
+ "math/rand"
)
// Uses the HSV color space to generate colors with similar S,V but distributed
// evenly along their Hue. This is fast but not always pretty.
// If you've got time to spare, use Lab (the non-fast below).
func FastWarmPalette(colorsCount int) (colors []Color) {
- colors = make([]Color, colorsCount)
+ colors = make([]Color, colorsCount)
- for i := 0 ; i < colorsCount ; i++ {
- colors[i] = Hsv(float64(i)*(360.0/float64(colorsCount)), 0.55 + rand.Float64()*0.2, 0.35 + rand.Float64()*0.2)
- }
- return
+ for i := 0; i < colorsCount; i++ {
+ colors[i] = Hsv(float64(i)*(360.0/float64(colorsCount)), 0.55+rand.Float64()*0.2, 0.35+rand.Float64()*0.2)
+ }
+ return
}
func WarmPalette(colorsCount int) ([]Color, error) {
- warmy := func(l, a, b float64) bool {
- _, c, _ := LabToHcl(l, a, b)
- return 0.1 <= c && c <= 0.4 && 0.2 <= l && l <= 0.5
- }
- return SoftPaletteEx(colorsCount, SoftPaletteSettings{warmy, 50, true})
+ warmy := func(l, a, b float64) bool {
+ _, c, _ := LabToHcl(l, a, b)
+ return 0.1 <= c && c <= 0.4 && 0.2 <= l && l <= 0.5
+ }
+ return SoftPaletteEx(colorsCount, SoftPaletteSettings{warmy, 50, true})
}
-