Rational design of diketopyrrolopyrrole-based multifunctional materials for organic light-emitting diodes and organic solar cells