Fix contrast percentage handling, fixes #1144
Merge pull request #1145 from Synchro/master

Contrast percentage fix for #1144