Closed dilyanpalauzov closed 8 months ago
Did you enable the "inline SVG" setting ?
The description of Inline SVG is:
If enabled, any SVG icon provided by the openHAB icon server will automatically be converted to an inline SVG in the WEB page, allowing control of its color with the sitemap widget property "iconcolor" in the case where the SVG icon sets "currentColor" as the fill color. Note that this will work with custom SVG icons but not with all the packaged icons from the classic iconset since they are defined with a hard-coded color palette. This feature is disabled by default.
After I enabled it, the icon colours were applied.
As the description does not contain any drawbacks for Inline SVGs the user (I) cannot anticipate any reasons why not to enable it. Please either extend the above description to include pro- and contra of enabling the option, or remove the option and always enable Inline SVGs.
The advantage is the ability to control the color for icons compatible with that feature. Classic iconset from OH does not support that feature.
The disadvantages are non standard additional treatment to load SVG images, bigger page size (SVG images are then inside the page) and I am not 100% sure that the browser cache is fully working.
My advice is to not enable it except you really want to control icon color and you use icons supporting that feature.
I will try to enhance a little the description.
I should also mention that material/framework7/iconify icons are not concerned. I could replace the last sentence by: This feature is disabled by default due to additional non-standard processing required leading to a larger page size and because it is unnecessary if you only use Material/framework7/iconify icons or openHAB icons from the classic icon set.
I have this file under openhab/icons/classic/on.svg:
and an element in sitemap:
Essentially it shows a black
O
in light mode, and a whiteO
in dark mode by usingfill:currentColor
.I change the element to
I would expect that now the color of the
O
is green, red or blue. In BasicUI it is still white or black, while Android-Openhab shows it coloured.BasicUI shall display the
O
coloured, too.