Color force acting on a quark in the pion and nucleon