palettenom

package module
v0.0.0-...-89cc52a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2020 License: BSD-3-Clause Imports: 6 Imported by: 0

README

PaletteNom

🧵 Load a color palette from an image.

PaletteNom noms out 64 colors from an 8x8 image and spits them out to an array.
The use of this in Pinwheel is to get its 64 color palette easily from a single image.

Example

package main

import (
	"fmt"

	"github.com/PinwheelSystem/PaletteNom"
)

func main() {
	palettelib := palettenom.New()
	colors, err := palettelib.Load("palette.png")
	if err != nil {
		panic(err)
	}

	r, g, b, _ := colors[0].RGBA()
	fmt.Println("The 1st color in RGB is:", r, g, b)
}

License

BSD 3-Clause

Documentation

Overview

PaletteNom loads a 64 color palette from a 8x8 image

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PaletteNom

type PaletteNom struct {
	Palette []color.Color
}

Contains our palette data

func New

func New() PaletteNom

Creates a new PaletteNom instance

func (*PaletteNom) Load

func (p *PaletteNom) Load(filename string) ([]color.Color, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL