Hi nicolas Thanks for the information of color I was also looking for it. The other packages that extended color used 1/1000 so I followed the pattern. I was thinking that I should use something like "printInexactlyOn:" Now (too early for my brain to work) but I'm wondering the different between round and roundUpTo: I remember that once we discuss having an exact method where we can pass the precision. Stef On Tue, Dec 26, 2017 at 11:51 PM, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com> wrote:
Hi Hilaire, it' not just funny: it's the exact case round: was made for. Note that there is an opened issue suggesting the removal of round: (no time to check the exact ref now).
Alternatives if round: is deprecated could be:
(c / 255 roundTo: 1/1000) asFloat. (c / 255 roundTo: 0.001s) asFloat.
I didn't verify if Pharo did change that, but Squeak RGB color components have 10 bits internally. 10 bits is 1024. So rounding to 1/1000 was not enough to distinguish different colors.
Nicolas
2017-12-26 22:26 GMT+01:00 Hilaire <hilaire@drgeo.eu>:
It i s funny to note how #round: message seems to have more success for that:
0.9420000000001 round: 3. "0.942"
Le 26/12/2017 à 21:27, Stephane Ducasse a écrit :
0.9420000000001 roundUpTo: 0.001 and the same truncatedTo: 0.001 do not work
-- Dr. Geo http://drgeo.eu