fix bug regarding color and %g