Is there a standard XML or JSON schema for color palettes?

Update almost a year later:

I never did find an XML or JSON color palette format. Instead, I discovered Photoshop .ACO files and GIMP's .gpl files.

GPL is a very simple ASCII color palette file format, requiring no explanation at all. It looks like this:

GIMP Palette
Name: Power Palette
Columns: 0
#
255   0   0 Red
255 255 255 White
  0   0   0 Black

ACO is a more complicated, binary format. More information on how to read/write this format here.

Converting from GPL to XML or JSON would be dead simple.

Additional possible file formats include:

  • cpt
  • c3g
  • ggr
  • gpf
  • inc
  • psp
  • sao
  • svg

See the Archive of Colour gradients for details.


If you are looking for named colors, consider google closure libs. Or do you want to describe the visual layout of a palette in a micro-format?

goog.provide('goog.color.names');


/**
 * A map that contains a lot of colors that are recognised by various browsers.
 * This list is way larger than the minimal one dictated by W3C.
 */
goog.color.names = {
  'aliceblue': '#f0f8ff',
  'antiquewhite': '#faebd7',
  'aqua': '#00ffff',
  ...

Swatches and free software - Color swatch file formats has an analysis on this topic, including an overview of different XML formats in use by, both proprietary and open source, vendors. It contains examples for each format, including a view onto the binary header.

As for XML, it names these proprietary formats:

  • ACBL (Adobe Color Book Legacy)

    • PANTONE opaque couché.acbl (Adobe Illustrator CS3)
  • ACB (AutoCAD Color Book)

    • Pantone A & I-cotton.acb (AutoCAD 2008)
  • QCL (QuarkXPress Color Library)

    • PANTONE(R) solidinhex.qcl (QuarkXPress 7.31)
    • Solid Hex UI Spec.cui (QuarkXPress 7.31)

For the open source formats it lists these applications as having an XML based format:

  • Scribus
  • sK1
  • SOC (StarOffice Colors) (OpenOffice.org, LibreOffice, etc.)

In such a case, when you can not find a standard format, I usually recommend taking a format, that is closest to be a standard (because it is popular) or a standard for something else but is well documented. In this case, I'd go for the SOC (StarOffice Colors), since it seems to be used by OpenOffice and LibreOffice, or maybe SVG has a concept of color definition.

The website mentioned before also hosts a conversion utility for different palette formats, introducing its own XML based format, the SwatchBooker file format (.sbz):

Tags:

Xml

Colors

Json