update: add *.swp to gitignore
add: add two function for color type converting.