anypalette
Advanced tools
Changelog
[0.6.0] - 2021-01-27
AnyPalette.uniqueColors(palette)
color.is(colorB)
is now Color.is(colorA, colorB)
and does a comparison based on component values instead of the string representation.palette.withDuplicates
: Duplicate colors are included by default now.RandomPalette
, RandomColor
, gimmeAPalette
palette.loader
, matchedLoaderFileExtensions
var fileContent = AnyPalette.writePalette(palette, AnyPalette.formats.GIMP_PALETTE)
to save a GPL file. Many formats are supported.AnyPalette.uniqueColors(palette)
: Use this to get a version of a palette with only unique colors.
Note: numberOfColumns
on the returned palette is undefined, because the geometry doesn't necessarily apply if some colors are removed.
name
is however copied over.Color
objects now have red
, green
, blue
properties. The range is [0,1]
, not [0,255]
, and they are available even if the input format is HSL or another color space.color.alpha
exists only if alpha is defined for a color. This is used for choosing between string representations.loadPalette
callback now gets extra parameters for getting info about the format the file was parsed as.ArrayBuffer
or Node.js Buffer
as input to AnyPalette.loadPalette({data}, callback)
. This is preferred over binary strings because it supports Unicode (UTF-8) encoded string names (and it's generally more modern).palette.name
and palette.description
are now available, for some palette formats..aco
) read and write support.ase
) read and write support.skp
) read and write support.soc
) read and write support.pal
palette.spl
paletteArrayBuffer
or another input type instead.Changelog
[0.5.2] - 2021-01-15
Changelog
[0.5.1] - 2021-01-14
.act
) palettes now have numberOfColumns
defined as 16
. The palette view in Photoshop can be resized, but some palettes, such as Visibone, rely on the default size of 16 columns.Changelog
[0.5.0] - 2020-06-14
#a9e
).cs
.act
loader (This very simple format overlaps with the Starcraft palette format, so some .act
files would already be loaded with the Starcraft loader, but now the name shows up as "Adobe Color Table" instead of "Starcraft palette" in the demo, which is nice.)Changelog
[0.4.0] - 2020-06-12
.colors
KDE RGB Palette loader from "KDE RGB palette" to "KolourPaint palette".spl
loader from "Sketch RGB palette" to "Skencil palette".hpl
loader from "HPL palette" to "Homesite palette".skp
loader (not very generalized - these files are Python source code as far as I can tell - but supporting RGB, CMYK, Grayscale, and a palette name
, description
, and numberOfColumns
).theme
and .themepack
loaderChangelog
[0.3.0] - 2020-06-10
.gpl
loader: The first line after the "GIMP Palette" line was accidentally skipped, which could lead to missing the first color, or missing the name of the palette, but it's now parsed correctly..spl
loader for Skencil palettes ("Sketch RGBPalette" - Skencil was formerly called Sketch).sketchpalette
loader for Sketch palettes (unrelated to Skencil .spl
files).colors
loader for KolourPaint palettesChangelog
[0.2.0] - 2020-06-09
AnyPalette.load
is now AnyPalette.loadPalette
; this is so with destructuring you get a clearly named function ("load" would be too generic). (Also, it has the name of the class that it loads, which is a nice bit of self-documentation. It doesn't load an AnyPalette
(that's the namespace), it loads a Palette
)n_columns
is now numberOfColumns
has_dimensions
is now geometrySpecifiedByFile
)loaded_as
and loaded_as_clause
are replaced with loader: {name, fileExtensions, fileExtensionsPretty}
and matchedLoaderFileExtensions
)