Add a colormap
One JSON file for each map, with its source and its license
A colormap of the field presenters of Construct is data: one JSON file for each map. Mesh and tet items lists the maps that ship.
Write the file
Add one JSON file to src/libs/libstyle/resources/colormaps/. It needs no
change to the code. The build ships every file in the folder, and the file
name is the colormap's id.
{
"name": "Blue, green, red",
"comment": "What the map is for.",
"kind": "rainbow",
"source": "https://gitlab.com/octomy/octomy",
"license": "LicenseRef-OctoMY",
"space": "srgb",
"stops": [
{ "at": 0.0, "color": [0.05, 0.05, 0.95] },
{ "at": 1.0, "color": [0.95, 0.05, 0.05] }
]
}
kindissequential,diverging,rainboworbands.sourceandlicenseare required.licenseis an SPDX id.atis a position from 0 to 1. Between two stops the color blends in a straight line inspace.spaceissrgb,linearoroklab. It tells how to read thecolorvalues and where to blend them."interpolation": "moreland"blends the first and the last stop as Moreland's diverging maps do.- A colormap needs at least two stops.