Fixed bad index retrive for foreground color