Major changes and bugfix to color.cpp

code compiles and works properly