You could pass in the constants, if that is what you need?
function drawTopLeftCorner(C, x, y) { g.setColor(C.color.primary.base); .... // then in a public method: drawTopLeftCorner(this,x,y)
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
You could pass in the constants, if that is what you need?