I want to return a color based on the user input: x
x <= -5 color:red
x < 0 color:yellow
x = 0 color:grey
x > 0 color:blue
x >= 5 color:green
As a test, I have implemented the below solution.
<$vars x=-3><!-- change x here -->
<$list filter="[<x>compare:number:lt[0]then[yellow]] [<x>compare:number:lteq[-5]then[red]] [<x>compare:number:gt[0]then[blue]] [<x>compare:number:gteq[5]then[green]] +[last[]]" emptyMessage=grey>
<<currentTiddler>>
</$list>
</$vars>
Copy paste in an empty tiddler in
https://tiddlywiki.com/ and change x and see the result, it works fine, but seems a lengthy solution.
What simpler, more semantic alternative do you propose?