Your coloured object is absorbing light, i.e. light is changing into mechanical energy, while the atoms in the Bunsen burner are emitting light, i.e. mechanical energy is changing into light.
If you have, for example, sodium atoms in a flame those atoms are continuously colliding with air molecules. The velocities of the air molecules are a function of temperature and are described by the Maxwell-Boltzmann distribution. At typical flame temperatures the average energies of gas molecules are well below the energies of electronic transitions in sodium, however the Maxwell-Boltzann distribution has a tail of very high velocities. The small percentage of gas molecules with high energies can collide with the sodium atoms hard enough to excite their electrons into a higher energy state. The atoms then relax and emit photons by spontaneous emission.
So in the flame the emission of the light is cooling the flame by turning the mechnical energy of the gas molecules into light. As you correctly say in your first paragraph, when light is absorbed it causes electronic transitions in the solid and these then transfer their energy into mechanical energy of the solid thereby heating it. The two processes are opposites of each other.