func PaletteFrom(path string) Palette {
	var pal = Palette{
		ByName: map[string]Index{},
	}
	f, err := os.Open(internal.Path + path + ".png")
	if err != nil {
		return pal
	}
	defer f.Close()  
	cf, _, err := image.DecodeConfig(f)
	if err != nil {
		return pal
	}
	p, ok := cf.ColorModel.(stdcolor.Palette)
	if !ok {
		return pal
	}
	for i := range p {
		r, g, b, al := p[i].RGBA()
		if i == 0 {
			continue
		}
		if i > 255 {
			return pal
		}
		c := SRGBA{
			R: float32(r) / float32(0xFFFF),
			G: float32(g) / float32(0xFFFF),
			B: float32(b) / float32(0xFFFF),
			A: float32(al) / float32(0xFFFF),
		}
		pal.Colors = append(pal.Colors, LRGBAof(c))
	}
	internal.Debug.Printf("Loaded color palette (%d entries) from %s", len(p), path)
	return pal
}
//////////////////////////////////////////////////////////////////////////////
PaletteFrom returns a new Palette created from the file at the specified
path.
package color
import (
	"image"
	stdcolor "image/color"
	"os"
	"github.com/cozely/cozely/internal"
)
type Palette struct {
	ByName map[string]Index
	Colors []LRGBA
}
type Index uint8