Skip to content

ColourParser

Pieter Verschaffelt edited this page Aug 11, 2017 · 1 revision

The ColourParser class can be used to parse a JSON-file containing a list of colors. The colors form the bases of a ColourPalette and can then be used to find a color that's closest to another color.

Parser format

The JSON-file that's parsed by the ColourParser should follow this structure:

{
  "data": [
    {
      "hexString": "#000000"
    },
    {
      "hexString": "#FFFFFF"
    }
  ]
}

A color should be represented using the HTML-like syntax. A color can include more properties, but these will be ignored by the parser. The hexString property is mandatory and can not be skipped!

Clone this wiki locally