mapserver/colormapping/palette_test.go
2019-06-19 21:12:04 +02:00

31 lines
393 B
Go

package colormapping
import (
"fmt"
"io/ioutil"
"testing"
)
func TestNewPalette(t *testing.T) {
data, err := ioutil.ReadFile("./testdata/unifieddyes_palette_extended.png")
if err != nil {
t.Fatal(err)
}
palette, err := NewPalette(data)
if err != nil {
t.Fatal(err)
}
color := palette.GetColor(0)
if color == nil {
t.Fatal("color not found!")
}
fmt.Println(color)
}