Problem
The colour code (e.g. #FC7D00) is known in the application of a specific module.
In mappView, this colour should now be displayed on a specific screen to show the user which colour is currently being used.
The colour code can be any code.
So the code #0000FF should lead to
and the code #FC7D00 should lead to
We have already tried various approaches to solve this problem, but none of them work or are quite complex.
Approach 1 - Image-Widget - styles
If the image widget is used, the fill colour can be transferred via a property (a stylable property).
With this variant, the colour can be switched to that of a specific style, but not to any colour code.
Approach 2 - Paper-Widget - Transformationen
By passing the transform-string to a paper-widget, the style of a specific object can be changed.
With this variant, the colours can be switched, but only from a list of colours that are permanently transferred to the widget via the style.
Switching via the colour code is supported by svg, but not by the paper widget.
Approach 3 - Paper-Widget - Content
Another approach is, to create the complete svg content, inclucding the style, in an content string in the application and bind this string to the paper-widget.
Although this approach works, it requires complex string operations and is quite time-consuming, especially when more complex shapes need to be coloured.
Approach 4 - Custom widget
Using the mappView widget development toolchain, it would be possible to create a widget to which this code can be passed.
Perhaps such an approach would be possible, but it is so time-consuming and complex that it is not worthwhile for such a supposedly simple problem.
Does anyone see another, simpler approach that we haven’t thought of yet?