From the original emails:
I have a computed ::Number value which is a float between 0 and 1. How do I get an integer to dynamically construct an RGB value?
import image as I
import image-structs as C
I.circle(20, "solid",C.color(240,1,240,1)) # ==>magenta circle
I.circle(20, "solid",C.color(240.2,1,240,1)) # ==>black circle
And
The code below will work, using num-exact to force the number to be exact. But I'm not happy with two things here that will get fixed:
truncate/floor/ceiling should produce exact results
- one of
color or circle should have given you an error message, not produced bogus answers
I.circle(20, "solid",C.color(240,1,num-exact(num-truncate(240.1)),1)) # ==>magenta circle