Can anyone come up with a more readable way of doing this?

As a function it will return an html string text with a color based on the
intensity value from 0 green to 100 red (ish)

; intensity is an integer between 0-100
color-text: func [ intensity text ] [
     temp: join to-string pick to-hex to-integer (2.5 * intensity) 7 to-string
pick to-hex to-integer (2.5 * intensity) 8
     return rejoin [ {<font COLOR="#} temp {8000">} text {</font>} ]
]

What I really need is a solution for
>> to-integer #{FF}
== 255
>> to-hex 255
== #000000FF

not #FF

and you can't trim hex values as far as I know :)

cheers,

john

Reply via email to