I am trying to generate style.json for MapLibre GL JS or Mapbox GL JS. This is the first attempt.
Check how module works
colors.pkl
module colors
red { "rgb" 255 0 0 }
green { "rgb" 0 255 0 }
blue { "rgb" 0 0 255 }
use_color.pkl
import "colors.pkl"
the_color = colors.blue
Makefile
use_color:
pkl eval -f json use_color.pkl
Result
{
"the_color": [
"rgb",
0,
0,
255
]
}
Ok.
Top comments (0)