openhab / openhab-ios

The repository of the iOS client
Eclipse Public License 2.0
193 stars 128 forks source link

Named colors ('green') not supported #112

Closed metbril closed 6 years ago

metbril commented 7 years ago

The current version of the iOS app does not support the generally agreed standard codes for valuecolor.

The documentation on colors for sitemaps lists a table with named color values (e.g. 'red', 'green', 'blue') that should be supported across UIs (see my boldified text).

Below you can find a list of standard colors and their respective RGB color code. Please take note, that other colors can be used. It is generally expected that valid HTML colors will be accepted (e.g. “green”, “lightgrey”, “#334455”), but a UI may only accept internally defined colors or work with a special theme. The given color names are agreed on between all openHAB UIs and are therefor your safest choice.

The current workaround is to use HTML hex RGB codes instead, but I feel that at least the named colors in the docs table should be respected.

https://community.openhab.org/t/openhab2-valuecolor-not-changing-in-ios-app/14831/2

ThomDietrich commented 7 years ago

That's indeed unfortunate. One goal of sitemap definitions is that they should produce the same view on all clients.

@digitaldan any chance you could have a look?

@rtvb fixing this issue might actually be easy. The interesting code part seems to be here. valuecolor/labelcolor are String members, you just need to add a translation from colorname to hex or UIColor.

metbril commented 7 years ago

I have created a PR https://github.com/openhab/openhab-docs/pull/478. Please remember to also revert that when this issue is resolved.

ThomDietrich commented 7 years ago

@digitaldan I've merged the warning about this limitation (see PR above) into docs. However this is of course not the solution we should settle with. Any plans when or if to work on this issue on your side? Best regards!