Documenting .sample files
Product |
Darcy Sample |
---|---|
Category |
Developer |
Last Updated |
|
Darcy Sample palette files (.sample
) are used to easily share and import palettes in Darcy Sample while maintaining all the metadata that the app uses. They can hold multiple palettes made up of multiple colors, and each palette/color can hold optional metadata like names and dates.
The file itself is JSON, usually minified, with the .sample
file extension and made up of a strict structure. An example can be found below the object tables.
Root
Name | Type | Required | Description |
---|---|---|---|
sampleExportVersion |
Float | Yes | The file format version, not the app version that created the file. Minor versions (the decimal) are designed to be backwards compatible, major versions (whole number) are not. Currently highest file format version is |
palettes |
Array<Palette> | Yes | List of palettes contained in the file. |
Palette Object
Name | Type | Required | Description |
---|---|---|---|
name |
String | Yes | Name of the palette. |
colors |
Array<Color> | Yes | List of colors contained in the palette. |
dateCreated |
Int | No | Epoch timestamp of the palette's creation. |
dateModified |
Int | No | Epoch timestamp of the palette's last modification, including any modifications to children colors. |
favorite |
Boolean | No | Should the palette be represented as a favorite in the UI. |
Color Object
Name | Type | Required | Description |
---|---|---|---|
valuesFormat |
Int | Yes | Describing how the
|
values |
Array<Int> | Yes | Values and bounds are defined by the For example, sRGB would require 3 values, each between 0 to 255. |
alphaValue |
Float | Yes | Float between 0 to 1 to represent the alpha value of the color. |
name |
String | No | User given name of the color. |
dateCreated |
Int | No | Epoch timestamp of the color's creation. |
dateModified |
Int | No | Epoch timestamp of the color's last modification. |
Example
A live example of downloadable palette files can be found on the Darcy Color Moodboard.
The following example is from the moodboard and contains a single palette with three colors:
{ "palettes": [ { "name": "Holo Controller", "dateCreated": 1649773966, "dateModified": 1649773966, "favorite": false, "colors": [ { "values": [ 117, 209, 194 ], "alphaValue": 1, "valuesFormat": 0, "dateCreated": 1649773966, "dateModified": 1649773966 }, { "values": [ 223, 135, 188 ], "alphaValue": 1, "valuesFormat": 0, "dateCreated": 1649773966, "dateModified": 1649773966 }, { "values": [ 227, 222, 231 ], "alphaValue": 1, "valuesFormat": 0, "dateCreated": 1649773966, "dateModified": 1649773966 } ] } ], "sampleExportVersion": 1 }