Marius Gedminas wrote:
I liked the blog entry and started looking around in the svn repository browser (no syntax highlight, *sigh*). I think there's a bug in ColorRGBA.grey: the 'a' argument (alpha?) is required, but never used.
Yeah, fixed that in my local version.
I want to use floats internally, so that it will always use float arithmetic. I _could_ simply wrap the setter value with float(), but that would leed to the situation where you could do col.r = "20" - which is just wrong. Coercing to a float also turned out to be comparatively slow in my tests. So I took the decision to enforce using floats. I think its best to be explicit, but I am open to suggestions...I'm somewhat surprised that your r/g/b/a setters perform an isinstance check and explicitly require a float. What's wrong with accepting ints (0 or 1)?
Thanks, fixed. You're right about unit tests. I'm in the process of adding them.The __setitem__ has an obvious error ('value' is misspelt as 'vale'), which makes me think you don't have unit tests.
Why is __rmul__ doing division instead of multiplication?
Fixed in SVN. Will