• Nanostructured PANI films are prepared by combination of galvanostatic and CV technique. • The films show remarkable flexibility, electrochromic efficiency and multicolor feature. • A smart supercapacitor is presented and displays high specific capacitance of 473.3 F g −1 . • The level of energy storage can be monitored by the change of optical performance. The flexible polyaniline (PANI) thin films with modified nanostructure are prepared on flexible indium tin oxide (ITO)/polyethylene terephthalate (PET) substrates by combination of galvanostatic and cyclic voltammetric electrodeposition techniques. The electrochemical properties of as-prepared PANI nanomaterials are investigated by using the PANI film as an active material of the electrode for primary electrochromic device and electrochemical supercapacitor. This film presents a remarkable mechanical flexibility, high coloration efficiency of 80.9 cm 2 C −1 at 630 nm and noticeable multicolor performances with reversible color change of transparent, pale yellow, green, blue and blue-purple. Further, a smart supercapacitor is presented, and the level of energy storage can be monitored by the change of optical performance. The film displays the highest specific capacitance of 473.3 F g −1 at the scan rate of 0.03 V s −1 . The high-performance PNAI film exhibits promising features for various emerging flexible and multicolor electronics and optoelectronic devices combining energy storage and electrochromism.