klen/python-scss — pull request #25 by quinox (2011-12-18 13:13:38+00:00)
Title: Fix broken invert function

The invert-function in trunk is broken because it tries to assign to a tuple:

```
(scss)quinox@tikko ~/tmp/scss $ echo 'invert(#567)' | scss
Traceback (most recent call last):
File "/home/quinox/tmp/scss/bin/scss", line 8, in
load_entry_point('scss==0.8.71', 'console_scripts', 'scss')()
File "/home/quinox/tmp/scss/lib/python2.7/site-packages/scss/tool.py", line 185, in main
outfile.write(s.load(infile))
File "/home/quinox/tmp/scss/lib/python2.7/site-packages/scss/parser.py", line 353, in load
return ''.join(map(str, nodes))
File "/home/quinox/tmp/scss/lib/python2.7/site-packages/scss/value.py", line 100, in __str__
return str(self.value)
File "/home/quinox/tmp/scss/lib/python2.7/site-packages/scss/control.py", line 66, in value
first = first.value
File "/home/quinox/tmp/scss/lib/python2.7/site-packages/scss/control.py", line 88, in value
return func(*params, **kwargs)
File "/home/quinox/tmp/scss/lib/python2.7/site-packages/scss/function.py", line 268, in _invert
c[0] = 255.0 - c[0]
TypeError: 'tuple' object does not support item assignment
```

I fixed it by creating a new ColorValue object instead. I've added a few testcases for the invert-function and one for the adjust-lightness function as well.