Fixed bug when inverting colors
Fixed bug when inverting colors
Fixed bug and refactorings