popup color palette window flags & code refactor

Note: Color changes when you close window by pressing [x] button
or press c key