Palette Codec
object PaletteCodec
Reads a Palette from the two plain-text formats pixel artists share palettes in, told apart by the file's extension, and writes one as .hex:
.gpl, the GIMP palette: aGIMP Palettefirst line, optionalName:,Columns:andChannels:headers and#comments, then onered green blue [name]line per colour — orred green blue alpha [name]underChannels: RGBA, where every alpha must be 255;.hex, onerrggbbper line, with or without a leading#, as Lospec exports it.
Entry names are not kept. Anything else is a PaletteFormatException naming the line; Roto only reads .gpl, and writes only .hex.
Functions
Link copied to clipboard
Writes palette to path as .hex: one lower-case #rrggbb per line, UTF-8, \n endings, through AtomicFile. Any other extension is a PaletteFormatException.