{FG,BG}_{GREEN,BLUE} and save[Fg,Bg}{Red,Green,Blue} should be unsigned chars or ints since their values range from 0-255. int is probably better to avoid bugs caused by mixing signed and unsigned values.