Yes, that seems to be a bug in cssutils that does a case sensitive match with 'rgb(', 'rgba(' and relatives, while it should be ASCII case insensitive.
I'll file a bug report to cssutils.
In the meantime the workaround is, as suggested by Doitsu, to use only lowercase characters for color functions.
(I think that the patch in cssutils should be something like this...
In cssutils/css/value.py, in method _setCssText of class ColorValue:
Code:
noalp = Sequence(Prod(name='FUNCTION',
match=lambda t, v: t == types.FUNCTION and
v in ('rgb(', 'hsl('),
...
witha = Sequence(Prod(name='FUNCTION',
match=lambda t, v: t == types.FUNCTION and
v in ('rgba(', 'hsla('),
should become:
Code:
noalp = Sequence(Prod(name='FUNCTION',
match=lambda t, v: t == types.FUNCTION and
v.lower() in ('rgb(', 'hsl('),
...
witha = Sequence(Prod(name='FUNCTION',
match=lambda t, v: t == types.FUNCTION and
v.lower() in ('rgba(', 'hsla('),
).
Thanks for the bug report!