<@U2RQ03PDW> Here's the code for the binding I men...
# tornadofx
r
@camdenorrb Here's the code for the binding I mentioned. It should work as expected, but I haven't tested it thoroughly. One caveat is that you can't use
property1.unbindBidirectional(property2)
, so you instead have to call
unbind()
on the returned binding. (This is due to private constructors in JavaFX and can't be worked around)
The converter was pretty simple:
Copy code
object BackgroundColorConverter : Converter<Background, Color> {
    override fun convertTo(value: Background) = value.fills.firstOrNull()?.fill as? Color ?: Color.TRANSPARENT
    override fun convertFrom(value: Color) = Background(BackgroundFill(value, null, null))
}