An extensive study of the optical absorption spectra of the blue fluorescent protein (BFP) is presented. We investigate different protonation states of the chromophore (neutral, anionic, and cationic) and analyze the role of the protein environment and of thermal fluctuations. The role of the environment is 2-fold: (i) it induces structural modifications of the gas-phase chromophore, the most important being the torsion of the imida rings; and (ii) it makes a local-field modification of the external electromagnetic field. It turns out that the torsion of the imida rings shifts significantly the gas-phase spectra to lower energies, whereas the consistent inclusion of the closest residues field produces only minor modifications on the spectra. From all of the configurations studied, the neutral cis-HSD and the anionic HSA seem to be the most likely candidates to explain the experimental spectrum. Furthermore, the present results clearly rule out the presence of the cationic protonation state (HSP) of the chromophore. However, a better description of the measured experimental absorption data may be obtained when the temperature fluctuations of the floppy torsional motion of the two imida rings are included. Our results, together with previous work on the green fluorescent protein, demonstrate the power of combining time-dependent density functional calculations and optical absorption measurements to discern the relevant chemical information on the nature and state of chromopeptides.