Band-gap tuning of pendant polymers for organic light-emitting devices and photovoltaic applications