luci-base: firewall.js: add getZoneColorStyle() helper
authorJo-Philipp Wich <jo@mein.io>
Thu, 11 Nov 2021 11:39:41 +0000 (12:39 +0100)
committerJo-Philipp Wich <jo@mein.io>
Tue, 15 Feb 2022 23:37:24 +0000 (00:37 +0100)
commita6bad6d9f87ed387e14f1ebbdaaafabf217bccde
treee4bcd689a6da7a908f4d5ee6c2b533f96d171af3
parent5a092b3ad23256f99ba08510fd11f6db28ca8f05
luci-base: firewall.js: add getZoneColorStyle() helper

The getZoneColorStyle() function will produce CSS style properties that
describe the color value of the zone. The color declaration is divided
into a CSS variable called `--zone-color-rgb` which holds the RGB value
of the color and a `background-color` property assigning these values
as background property.

This allows themes to override the color with derived values, e.g. by
applying an alpha channel.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit d775279dbd0da284af7f74b31b5d3b0eddcf80bc)
modules/luci-base/htdocs/luci-static/resources/firewall.js