palette

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: MIT Imports: 9 Imported by: 0

README

go-gimp-palette

Loader for the GIMP palette format

The format isn't documented, but we can figure it out from the source code:

  • File contents are UTF-8
  • Must have the magic header GIMP Palette
  • Following lines are Name: <palette name> and Columns: <no of columns>
  • Comment lines begin with #
  • All remaining non-empty lines will be in the format 65 12 255 color-name (the numbers being each rgb byte respectively and the color entry name being optional)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Palette

type Palette struct {
	Name     string
	Columns  int
	Comments []string
	Entries  []PaletteEntry
}

func ReadPalette

func ReadPalette(r io.Reader, parsingMode ParsingMode) (p *Palette, err error)

type PaletteEntry

type PaletteEntry struct {
	Name  string
	Color color.Color
}

type ParsingMode

type ParsingMode int
const (
	ParsingModeLenient ParsingMode = iota
	ParsingModeStrict
)

Jump to

Keyboard shortcuts

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