Colors are stored as CSS strings internally and are parsed by Jimp.cssColorToHex on rendering. All valid CSS color definitions are supported (e.g. HEX, rgba, named colors). Note: this requires a current version of Jimp.
Map colors can be configured in the config file via the mqtt.mapSettings.colors object, e.g.:
If the colors object is not present, the default colors are used.
It is possible to define an overlay and underlay image for the map by using the the optional parameters mqtt.mapSettings.overlay_path and mqtt.mapSettings.underlay_path. The overlay/underlay image has to be in a format supported by Jimp. The scale of the images can be controlled by the mqtt.mapSettings.overlay_scale and mqtt.mapSettings.underlay_scale parameters. Additionally, the images can be shifted by using the parameters mqtt.mapSettings.overlay_x and mqtt.mapSettings.overlay_y (mqtt.mapSettings.underlay_x and mqtt.mapSettings.underlay_y).
Important: When upgrading an existing installation, make sure to run npm install before npm start to upgrade Jimp.
Also please ignore commit 20e7cae ("Openhab colorscheme for map."). I included it by accident. The changes made in this commit have been made obsolete by the new configurable colors feature.
This pull request includes the following changes:
Jimp.cssColorToHex
on rendering. All valid CSS color definitions are supported (e.g. HEX, rgba, named colors). Note: this requires a current version of Jimp.Map colors can be configured in the config file via the
mqtt.mapSettings.colors
object, e.g.:If the
colors
object is not present, the default colors are used.mqtt.mapSettings.overlay_path
andmqtt.mapSettings.underlay_path
. The overlay/underlay image has to be in a format supported by Jimp. The scale of the images can be controlled by themqtt.mapSettings.overlay_scale
andmqtt.mapSettings.underlay_scale
parameters. Additionally, the images can be shifted by using the parametersmqtt.mapSettings.overlay_x
andmqtt.mapSettings.overlay_y
(mqtt.mapSettings.underlay_x
andmqtt.mapSettings.underlay_y
).Example configuration using the new features:
Important: When upgrading an existing installation, make sure to run
npm install
beforenpm start
to upgrade Jimp.Also please ignore commit
20e7cae
("Openhab colorscheme for map."). I included it by accident. The changes made in this commit have been made obsolete by the new configurable colors feature.