1 Introduction

Recently, advanced bionic materials and intelligent molecules with changeable color have attracted extensive attention [1,2,3]. Advanced photochromic materials have been widely used in sensors, anti-counterfeiting, optical information storage, and smart textiles [4,5,6]. Photochromism can be achieved in various materials, such as liquid crystals, organic and inorganic photosensitizers [7,8,9]. Organic photochromic molecules, such as azobenzene, diarylethene, spiropyran, spirooxazine, and protamine anhydride, are particularly suitable for textile applications due to their significant color change, low cost, and strong photosensitivity [10,11,12]. Spiropyran (SP) and its derivatives are famous for their good thermal stability and obvious color changes [13, 14]. SP molecules can be converted from the unconjugated closed-form to the conjugated merocyanine (MC) form by prolonging the π-electron delocalization under the UV light, and return to the original state when heated or exposed to visible light. However, due to the weak photosensitivity of the molecules, the photoisomerization of the most molecules usually occurs only in the solution with a relatively slow photo-response rate, which greatly hinders its practical applications [15, 16]. Therefore, one of the main tasks in developing solid-state photosensitive advanced materials is to improve the photosensitivity of photochromic molecules [17,18,19]. Photochromic materials with excellent photosensitivity and good reversibility have important applications.

In recent years, some researchers have focused on improving the photosensitivity of SP derivatives to achieve efficient stimulus switching in various states. Euchler et al. [20] prepared porous SP embedded polymethylsiliconisoxane polymer material through a two-step sol–gel method, which exhibited good photochromic properties in both solution and solid state. Evans et al. [21] reported that linking flexible oligodimethylsiloxanes with low glass transition temperatures to photochromic compounds greatly enhanced their switching speed and photochromic properties in rigid polymer matrices. Nonetheless, the synthesis conditions of the polymers are relatively complex and harsh. The photochromic properties of SP compounds can also be improved by embedding photochromic molecules into metal–organic framework (MOF) materials [22,23,24]. Besides, improving the photochromic properties of SP molecules by introducing rigid steric hindrance groups on the side chains to induce large free volumes is also an effective strategy [25]. Some studies have shown that the modification of flexible chains on side chains can significantly increase the flexibility of molecules, reduce the packing density, and thus reduce the intermolecular π–π interaction [26,27,28].

Herein, a series of novel SP compounds with different flexible isolation groups were designed and synthesized. The relationship of the photosensitivity and molecular free volume in both solution and solid states were systematically discussed. The photosensitivity enhancement mechanism was revealed by density functional theory (DFT) and molecular volumes calculations. The photochromic SP compounds were applied to dye polyester (PET) fabrics to obtain the smart color-changing textiles with different photosensitivity.

2 Experimental

2.1 Materials and Characterization

Phthalic anhydride (98%) and phenol (98%) were obtained from Sinopharm Chemical Reagent Co., Ltd. (Shanghai, China). 2, 3, 3-trimethylindolenine (98%), 5-nitrosalicylaldehyde (99%), 2-bromomethyl alcohol (98%), N-butanol (98%), N-octanol (99%), dodecanol (99%), dicyclohexylcarbodiimide (DCC, 99%), and 4-dimethylaminopyridine (DMAP, 99%) were all provided by Damas-beta Chemical Reagent Co., Ltd. (Shanghai, China). All reagents were used directly without further purification.

The UV–Vis absorption spectra were recorded by a UV-1800 spectrophotometer (Shimadzu, Japan). Fourier transform infrared (FT-IR) spectra were measured using a Perkin Elmer Spectrum Two (Perkin Elmer, USA). 1H NMR and 13C NMR spectra were collected at Bruker Avance 400 using deuterated chloroform or DMSO as the solvent (Bruker, Switzerland). MS spectra were carried out on a Waters XEVO-TQD QCA1056 Series LCMS system (Waters, USA). Melting points of the synthesized compounds were measured by the open capillary method using a Mel-Temp capillary melting point meter (Shanghai Precision Scientific Instruments Co., Ltd., China). The elemental compositions of the synthesized compounds were obtained with an Elmentar Vario EL III elemental analyzer (Germany Elmentar Instrument Manufacturing Co., Ltd., Germany). The apparent color depth (K/S value) of the photochromic PET fabrics were measured by Datacolor 650 (Datacolor, USA).

2.2 Synthesis of the Compounds with Different Flexible Isolation Groups

2.2.1 Synthesis of 2-(3',3'-dimethyl-6-nitrospiro[chromene-2,2'-indolin]-1'-yl) ethanol (SP-OH)

The SP-OH was synthesized according to the reported method, as shown in Scheme 1 [25]. Details as follows: 2, 3, 3′-trimethylindolenine (6.00 g, 37.68 mmol) and 2-bromoethyl alcohol (7.06 g, 56.52 mmol) were dissolved in acetonitrile (60 mL). The mixture was then refluxed and stirred for 24 h under nitrogen atmosphere. After natural cooling to room temperature, it was directly filtered, and the filter cake was collected and dried to obtain purple powder (7.78 g, yield: 72.65%). The obtained 1a was directly dissolved in an aqueous solution (160 mL) containing 2.46 g KOH, stirred for 15 min at room temperature, and then extracted with DCM (DCM, 30 mLx3). At last, the organic phase was dried with anhydrous sodium sulfate, and the DCM was distilled off under reduced pressure to obtain 1b as yellow oil (5.64 g, yield: 97.75%). 5-Nitrosalicylaldehyde (6.96 g, 41.63 mmol) and 40 mL of absolute ethanol were directly added to the above yellow oil, and then refluxed under nitrogen for 3 h, After natural cooling, the product was completely precipitated. After filtering and washing with a small amount of ethanol, SP-OH was obtained as purple powder (7.73 g, yield: 81.08%). mp: 178–179 °C; FT-IR ν (cm−1): 3351, 2969, 2871, 1608, 1577, 1478, 1331, 1272, 1124, 1089, 945, 917, 802, 745 (Figure S1); 1H NMR (400 MHz, DMSO-d6, δ ppm): 8.21 (s, 1H, Ar–H), 8.01–7.99 (d, 1H, Ar–H), 7.21–7.18 (d, 1H, Ar–H), 7.13–7.10 (t, 2H, Ar–H), 6.89–6.86 (t, 1H, Ar–H), 6.80–6.76 (t, 1H, Ar–H), 6.65–6.63 (d, 1H, Ar–H), 6.03–6.00 (d, 1H, Ar–H), 4.72 (s, 1H, –OH), 3.54–3.44 (m, 2H, –CH2), 3.23–3.16 (m, 2H, –CH2), 1.20 (s, 3H, –CH3), 1.10 (s, 3H, –CH3) (Figure S2); 13C NMR (100 MHz, DMSO-d6, δ ppm): 159.66, 147.32, 140.95, 135.94, 128.31, 128.03, 126.15, 123.26, 122.55, 122.12, 119.44, 119.28, 115.90, 106.89, 59.52, 52.80, 46.09, 26.23, 20.10 (Figure S3); MS (ESI): m/z calcd for C20H20N2O4: 352.14, Found: 353.08 (M + H+) (Figure S4).

Scheme 1
scheme 1

Synthesis route of SP-OH

2.2.2 Synthesis of 2-((2-(3',3'-dimethyl-6-nitrospiro[chromene-2,2'-indolin]-1'-yl) ethoxy) carbonyl) benzoic acid (SP-PA-COOH)

The SP-PA-COOH was synthesized according to the previous literature [29], as shown in Scheme 2. Compound SP-OH (2.00 g, 5.68 mmol) and phthalic anhydride (0.84 g, 5.68 mmol) were dissolved in toluene (30 mL). The mixture was stirred under refluxing in an N2 atmosphere for 14 h. After the reaction was completed, the mixture was cooled to room temperature, then directly filtered. The filter cake was collected to obtain SP-PA-COOH as white solid powder (2.12 g, yield: 74.65%). mp: 227–228 °C; FT-IR ν (cm−1): 3074, 2972, 2922, 2874, 2654, 2542, 1708, 1610, 1512, 1480, 1398, 1334, 1272, 1084, 954, 806, 748 (Figure S5); 1H NMR (400 MHz, DMSO-d6, δ ppm): 13.21 (s, 1H, –COOH), 8.14 (s, 1H, Ar–H), 7.95–7.93 (d, 1H, Ar–H), 7.73–7.72 (d, 1H, Ar–H), 7.63–7.53 (m, 3H, Ar–H), 7.17–7.11 (m, 3H, Ar–H), 6.84–6.80 (t, 2H, Ar–H), 6.77–6.75 (d, 1H, Ar–H), 5.96–5.93 (d, 1H, Ar–H), 4.37–4.31 (m, 2H, –CH2–), 3.58–3.52 (m, 2H, –CH2–), 1.19–1.07 (d, 6H, –CH3) (Figure S6); 13C NMR (100 MHz, DMSO-d6, δ ppm): 169.13, 168.48, 167.94, 159.50, 146.76, 140.97, 135.95, 132.42, 131.66, 131.21, 129.28, 128.68, 128.11, 126.19, 123.31, 122.33, 121.93, 119.90, 119.31, 115.87, 106.95, 106.67, 63.45, 53.00, 41.92, 26.03, 19.94 (Figure S7); Elemental Analysis: Calculated for C28H24N2O7 (500.16): C, 67.19; H, 4.83; N, 5.60. Found: C, 67.25; H, 4.76; N, 5.51; MS (ESI): m/z calcd for C28H24N2O7: 500.16, Found: 501.37 (M + H+) (Figure S8).

Scheme 2
scheme 2

Synthesis route of SP-PA-COOH

2.2.3 Synthesis of 2-(3',3'-dimethyl-6-nitrospiro[chromene-2,2'-indolin]-1'-yl) ethyl phenyl phthalate (SP-1)

The synthesis route of SP-1 is shown in Scheme 3. Compound SP-PA-COOH (0.80 g, 1.60 mmol) and phenol (0.15 g, 1.60 mmol) were dissolved in 10 mL dichloromethane (DCM) and stirred in an ice-water bath (0–5 °C). Then DCC (0.50 g, 2.42 mmol) and DMAP (0.02 g, 0.16 mmol) were added successively, and the reaction was completed after stirring for 3 h. The filtrate was collected and extracted with dichloromethane. Then, the organic phase was washed successively with 1 M hydrochloric acid, saturated sodium bicarbonate and deionized water. The organic phase was collected and dried with anhydrous sodium sulfate. After removing DCM under the reduced pressure, the crude product was recrystallized by ethanol to obtain SP-1 as beige solid powder (0.776 g, yield: 83.26%). mp: 131–132 °C; FT-IR ν (cm−1): 3071, 2960, 2862, 1753, 1718, 1607, 1506, 1481, 1332, 1270, 1190, 1091, 1058, 954, 808, 746 (Figure S9); 1H NMR (400 MHz, CDCl3, δ ppm): 7.95–7.92 (d, 1H, Ar–H), 7.87–7.86 (d, 2H, Ar–H), 7.68–7.66 (d, 1H, Ar–H), 7.63–7.56 (m, 2H, Ar–H), 7.39–7.35 (t, 2H, Ar–H), 7.23–7.16 (m, 4H, Ar–H), 7.10–7.08 (d, 1H, Ar–H), 6.92–6.88 (t, 1H, Ar–H), 6.82–6.79 (d, 1H, Ar–H), 6.70–6.65 (m, 2H, Ar–H), 5.81–5.79 (d, 1H, Ar–H), 4.49–4.45 (m, 2H, –CH2–), 3.67–3.48 (m, 2H, –CH2–), 1.25 (s, 3H, –CH3), 1.12 (s, 3H, –CH3) (Figure S10); 13C NMR (100 MHz, DMSO-d6, δ ppm): 166.82, 166.26, 159.45, 150.85, 146.76, 140.92, 135.94, 132.54, 132.28, 131.84, 131.04, 130.05, 129.51, 129.47, 128.80, 128.08, 126.60, 126.17, 123.28, 122.34, 121.93, 121.82, 119.95, 119.05, 115.82, 107.02, 106.62, 64.04, 52.97, 42.15, 25.94, 19.95 (Figure S11); Elemental Analysis: Calculated for C34H28N2O7 (576.19): C, 70.82; H, 4.89; N,4.86. Found: C, 70.73; H, 5.14; N, 4.95; MS (ESI): m/z calcd for C34H28N2O7: 576.19, Found: 577.48 (M + H+) (Figure S12).

Scheme 3
scheme 3

Synthesis route of SP-1 ~ SP-4

2.2.4 Synthesis of butyl (2-(3',3'-dimethyl-6-nitrospiro[chromene-2,2'-indolin]-1'-yl) ethyl) phthalate (SP-2)

Compound SP-PA-COOH (1.00 g, 1.50 mmol), N-butanol (0.15 g, 1.50 mmol) and DCC (0.62 g, 2.25 mmol) were dissolved in anhydrous dichloromethane (20 mL) at 0–5 °C. Then, DMAP (0.024 g, 0.20 mmol) was added. The mixture was stirred for another 8 h at room temperature. After the reaction, the precipitate was removed by filtration, the filtrate was extracted with dichloromethane, and the organic phase was washed successively with 1 M hydrochloric acid, saturated sodium bicarbonate and deionized water. The organic phase was dewatered with anhydrous sodium sulfate, DCM was evaporated under the reduced pressure, and the residue was recrystallized by ethanol to obtain SP-2 as yellow solid powder (0.88 g, yield: 79.28%). mp: 90–91 °C. FT-IR ν (cm−1): 3072, 2924, 2852, 1724, 1608, 1476, 1330, 1266, 1120, 1082, 950, 744 (Figure S13); 1H NMR (400 MHz, DMSO-d6, δ ppm): 8.15 (s, 1H, Ar–H), 7.94–7.92 (d, 1H, Ar–H), 7.70–7.62 (m, 4H, Ar–H), 7.19–7.12 (m, 3H, Ar–H), 6.84–6.82 (t, 2H, Ar–H), 6.77–6.75 (d, 1H, Ar–H), 5.96–5.93 (d, 1H, Ar–H), 4.41–4.32 (m, 2H, –CH2–), 4.15–4.12 (t, 2H, –CH2–), 3.62–3.49 (m, 2H, –CH2–), 1.60–1.53 (m, 2H, –CH2-), 1.33–1.20 (m, 5H, –CH2–, –CH3), 1.08 (s, 3H, –CH3), 0.86–0.82 (t, 3H, –CH3) (Figure S14); 13C NMR (100 MHz, DMSO-d6, δ ppm): 167.31, 167.28, 159.48, 146.74, 140.94, 135.94, 132.13, 132.02, 131.85, 131.65, 129.10, 128.79, 128.07, 126.17, 123.28, 122.32, 121.86, 119.93, 119.09, 115.85, 106.96, 106.63, 65.43, 63.76, 52.96, 42.04, 30.41, 26.00, 19.95, 19.06, 13.94 (Figure S15); Elemental Analysis: Calculated for C32H32N2O7 (556.22): C, 69.05; H, 5.80, N, 5.03. Found: C, 68.65; H, 5.90; N, 4.87; MS (ESI): m/z calcd for C32H32N2O7: 556.22, Found: 557.19 (M + H+) (Figure S16).

2.2.5 Synthesis of 2-(3',3'-dimethyl-6-nitrospiro[chromene-2,2'-indolin]-1'-yl) ethyl octyl phthalate (SP-3)

Compound SP-3 was synthesized from SP-PA-COOH and N-octanol by a similar way to the synthesis of SP-2. SP-3 was given as yellow powder (1.17 g, yield: 63.59%). mp: 71–72 °C. FT-IR ν (cm−1): 3066, 2928, 2855, 1726, 1608, 1478, 1334, 1270, 1126, 1082, 952, 746 (Figure S17); 1H NMR (400 MHz, DMSO-d6, δ ppm): 8.14–8.10 (d, 1H, Ar–H), 7.93–7.87 (dd, 1H, Ar–H), 7.69–7.55 (m, 4H, Ar–H), 7.17–7.09 (m, 3H, Ar–H), 6.82–6.74 (m, 3H, Ar–H), 5.94–5.89 (t, 1H, Ar–H), 4.40–4.31 (m, 2H, –CH2–), 4.13–4.10 (t, 2H, –CH2–), 3.60–0.349 (m, 2H, –CH2–), 1.58–1.53 (t, 2H, –CH2–), 1.23–1.16 (m, 11H, –CH2–, –CH3), 1.07–1.03 (m, 5H, –CH2–, –CH3), 0.83–0.80 (t, 3H, –CH3) (Figure S18); 13C NMR (100 MHz, DMSO-d6, δ ppm): 167.31, 167.21, 159.48, 146.73, 140.95, 135.93, 132.12, 132.02, 131.86, 131.65, 129.11, 128.79, 128.06, 126.17, 123.28, 122.31, 121.86, 119.93, 119.09, 115.83, 106.95, 106.64, 65.73, 63.72, 52.96, 42.06, 31.65, 29.04, 29.02, 28.37, 25.98, 25.81, 22.51, 19.94, 14.38 (Figure S19); Elemental Analysis: Calculated for C36H40N2O7 (612.28): C, 70.57; H, 6.58; N, 4.57. Found: C, 70.97; H, 6.79; N, 4.62; MS (ESI): m/z calcd for C36H40N2O7: 612.28, Found: 613.14 (M + H+) (Figure S20).

2.2.6 Synthesis of 2-(3',3'-dimethyl-6-nitrospiro[chromene-2,2'-indolin]-1'-yl) ethyl dodecyl phthalate (SP-4)

Dodecanol was used instead of N-octanol, according to the synthesis method of SP-2. SP-4 was obtained as pale pink powder (0.75 g, yield: 55.97%). mp: 58–59 °C; FT-IR ν (cm−1): 3066, 2924, 2868, 1726, 1608, 1476, 1332, 1268, 1122, 1080, 952, 744 (Figure S21); 1H NMR (400 MHz, DMSO-d6, δ ppm): 8.14 (s, 1H, Ar–H), 7.94–7.91 (d, 1H, Ar–H), 7.69–7.61 (m, 4H, Ar–H), 7.17–7.10 (m, 3H, Ar–H), 6.83–6.80 (m, 2H, Ar–H), 6.76–6.74 (d, 1H, Ar–H), 5.94–5.92 (d, 1H, Ar–H), 4.13–4.10 (t, 2H, –CH2–), 4.06–4.00 (dd, 2H, –CH2–), 3.61–3.46 (m, 2H, –CH2–), 1.58–1.55 (m, 2H, –CH2–), 1.23–1.16 (m, 24H, –CH2–, –CH3), 0.85–0.82 (t, 3H, –CH3) (Figure S22); 13C NMR (100 MHz, DMSO-d6, δ ppm): 167.30, 167.26, 159.48, 146.73, 140.94, 135.92, 132.12, 132.00, 131.84, 131.65, 129.11, 129.09, 128.79, 128.04, 126.15, 123.27, 122.30, 121.85, 119.92, 119.09, 115.82, 106.94, 106.64, 65.73, 63.71, 52.96, 42.06, 31.76, 29.48, 29.42, 29.36, 29.17, 29.07, 28.36, 25.98, 25.81, 22.56, 19.93, 14.39 (Figure S23); Elemental Analysis: Calculated for C40H48N2O7 (668.35): C, 71.83; H, 7.23; N, 4.19. Found: C, 71.74; H, 7.14; N, 4.36; MS (ESI): m/z calcd for C40H48N2O7: 668.35, Found: 669.41 (M + H+) (Figure S24).

2.3 Theoretical Calculations

Gaussian 09W software was used for theoretical calculation based on Density Functional Theory (DFT). The structures of the synthesized compounds were optimized at the calculated level of B3LYP/6-31G(d). The electrostatic potential energy distributions were obtained on the basis of the optimized structures. ChemBio 3D Ultra 14.0 software was used to calculate the molecular volume based on the Connolly Solvent Excluded Volume (CSEV) model.

2.4 Photochromic and Fading Kinetics of the Synthesized Compounds

The kinetics of photochromism and fading of the synthesized compounds were calculated according to Eq. (1):

$$ In\left( {\frac{{A_{t} - A_{e} }}{{A_{0} - A_{e} }}} \right) = kt + b $$
(1)

where A0, At, Ae represent the absorbance of maximum peaks (λmax) at 0 s, t s and discoloration (or fading) equilibrium, respectively; k represents the rate constant.

2.5 Preparation of Photochromic PET Fabrics

PET fabrics were dyed with STARLET DL-6000 infrared dyeing machine. The synthesized compound, 0.25 g, was well grinded with dispersant MF, 0.25 g, to prepare 10 g/L aqueous dye solution. A dye dosage of 2% (o.w.f) and acetic acid solutions (5 vol.%) were used to adjust the pH value of the dye bath to 4–5. The dyeing process was started at 30 °C and increased to 130 °C at a rate of 2 °C /min and maintained at this temperature for 60 min. After dyeing, the dyed PET fabrics were reduced and cleaned for 15 min in aqueous solutions containing sodium hydrosulfite (2 g/L) and sodium carbonate (2 g/L) at 85 °C.

2.6 Dyeing Rate and Exhaustion of Photochromic PET Fabrics

The dye exhaustion (E%) of the photochromic PET fabrics was measured by the following Eq. (2):

$$ E\% = \frac{{n_{0} A_{0} - n_{1} A_{1} }}{{n_{0} A_{0} }} \times 100\% $$
(2)

where A0 and A1 represent the absorbance of the dye solutions in DMF before and after dyeing, and no and n1 represent the dilution ratios of the dye solutions before and after dyeing, respectively.

2.7 Measurements of Photochromic PET Fabrics

The international standards ISO 105-C03 (2010) and ISO 105-X12 (2016) were used to evaluate the fastness properties of washing and rubbing, respectively.

The dyed PET fabrics were irradiated with UV light to achieve photochromic equilibrium and then returned to their original state under visible light irradiation. This process was repeated for 10 times. The maximum K/S values in the visible region of the PET fabrics were measured after each irradiation and compared with the original state of the fabrics.

3 Results and Discussions

3.1 Photochromic Sensitivities of the Compounds with Different Flexible Isolation Groups in Both the Solution and the Aggregate State

The spectral behavior of the synthesized compounds in acetonitrile solvent was determined by UV–Vis spectrophotometry, using SP-OH as a control sample. The main absorption peaks of the five compounds were located at 340, 343, 343, 341 and 342 nm, respectively, which were attributed to the n-π transition of the spiropyran moieties of the molecule. The photochromic properties of the synthesized compounds in solution are shown in Fig. 1. The five compounds (SP-OH, SP-1, SP-2, SP-3, and SP-4) in acetonitrile solution (1.0 × 10–4 mol/L) were all colorless. After 365 nm UV light stimulation, SP-OH solution changed from colorless to purple (Fig. 1a), while the solution of the other four compounds changed from colorless to blue–purple (Fig. 1b–e). The UV–Vis absorption spectra of the five compounds showed new absorption peaks at 559, 569, 569, 570 and 570 nm, respectively. These new absorption peaks corresponded to the π-conjugate extended open-loop type (MC), which confirmed the transformation from SP to MC structure. The absorption intensity increased gradually with the extension of UV irradiation time and remained unchanged at 330 s, 210 s, 120 s, 75 s and 60 s, respectively. They indicate that the photostationary states were reached. SP-1 to SP-4 had faster photo-response rates and shorter time to reach the photostationary state than SP-OH. The photo-response rate of SP-2 to SP-4 which substituted with flexible alkyl chains were faster than that of SP-1 substituted with a benzene ring. And the photoconversion rate got faster as the length of the alkyl chains increased, for the introduction of flexible chains improved the internal flexibility of the compounds. On the contrary, the introduction of the benzene ring resulted in a large steric hindrance, which was beneficial for the stabilization of the MC state. The solution color would fade back to colorless after the withdrawal of UV light, accompanied by the decrease of the absorption peak in the visible range. The recovery time for the five compounds was 480 s, 180 s, 45 s, 40 s and 40 s, respectively (Fig. 1f–j). Compared with SP-OH, the recovering rate of SP-1 to SP-4 were greatly improved, because the increased free volume reduced the intermolecular interaction force in the MC states. It should be pointed out that the substituents had a significant effect on the conversion speed between MC and SP. The fading speed of SP-2 to SP-4 was faster than that of SP-1, due to the fact that alkyl chains not only provided free volumes but also increased the flexibility of molecules, resulting in the improvement of the rotational freedom and photosensitivity enhancement. In addition, the kinetic analysis of the synthesized spiropyran compounds for discoloration (fading) further demonstrated that the flexible isolation groups improved the photosensitivity of the compounds (Table 1, Figure S25, 26).

Fig. 1
figure 1

Photochromic properties of the compounds in acetonitrile solution. a–e UV–Vis absorption spectra of SP-OH, SP-1, SP-2, SP-3 and SP-4 acetonitrile solution under UV irradiation for different time, respectively; f–j UV–Vis absorption spectra of SP-OH, SP-1, SP-2, SP-3 and SP-4 during the recovery process, respectively

Table 1 Rate constants of discoloration and fading for five compounds

The photochromic properties of the synthesized compounds in the solid state were also observed. As shown in Fig. 2a, the color of SP-OH had not obvious change under the continuous UV irradiation. In contrast, SP-1 to SP-4 solid powder indicated obvious photochromic behavior. With the extension of UV irradiation time, SP-1 changed from beige to purple, SP-2 and SP-3 changed from yellow to purplish red, and SP-4 changed from pale pink to dark purple. The response speed trend was consistent with that in the solution, clearly confirming the occurrence of the photoisomerization conversion in the solid state between SP and MC. The colors of SP-1 to SP-4 solid powder could also be returned to the initial state after being irradiated with visible light (LED, 5 W), showing good reversibility (Fig. 2b). However, the transition from MC to SP in the solid state usually requires overcoming much stronger intermolecular interaction and π–π stacking, and the recovering rate is much slower than that in solution [30]. The photochromic properties exhibited by SP-1 to SP-4 in the solid state provide the feasibility for developing photochromic materials with excellent properties and tunable photosensitivity.

Fig. 2
figure 2

Photos of the five compounds during the photochromic process under a UV light irradiation; b Visible light irradiation

To further understand the effect of substituents on the photochromic properties of the synthesized molecules, we investigated the detailed structural information of the molecules based on density functional theory (DFT) at the B3LYP/6-31G (d) level [25], as shown in Fig. 3. The calculation results show that the introduction of the flexible alkyl chains or the rigid groups enhanced the non-planarity of the molecules. The nonplanar π-conjugated structures provided large space volume and facilitated the conformational transition from SP to MC. The highest occupied molecular orbital (HOMO) and lowest unoccupied molecular orbital (LUMO) of the five molecules were mainly delocalized in the plane of MC portion, indicating efficient intramolecular electron transfer. Moreover, the orbital energy differences of HOMO and LUMO in SP-OH, SP-1, SP-2, SP-3 and SP-4 are 3.4678 eV, 3.2028 eV, 3.1984 eV, 3.1935 eV and 3.1621 eV, respectively. The energy level differences of SP-1 to SP-4 were much smaller than that of SP-OH, meaning that they are more prone to photoisomerization transition. Further compared the orbital energy level differences of SP-2 to SP-4, the value decreased with the extension of terminal alkyl chains, indicating the introduction of flexible alkyl chains in the molecule, was beneficial to the photosensitivity improvement. Although the rigid benzene ring could also endow the steric volume for isomerization, it also increased the steric hindrance of the molecule, which reduced the photosensitivity of the compound to a certain extent. The orbital energy differences of HOMO and LUMO of the MC isomers of the five compounds were 2.7900 eV, 2.6817 eV, 2.6531 eV, 2.5884 eV and 2.5641 eV, respectively, which were smaller than the energy level difference of SP, proving the possibility of photoisomerization between SP and MC. As mentioned above, the theoretical calculations were consistent with the experimental results.

Fig. 3
figure 3

Energy diagrams and electrostatic potential energy level diagrams of HOMO and LUMO orbits of the SP and MC isomers

The differences in the photosensitivity of the photochromic compounds may be attributed to the different free volume provided by the substituents. To verify this conclusion, we calculated the free volume of these compounds based on the CSEV model theory using ChemBio 3D Ultra 14.0 software [31]. The free volumes of SP-OH, SP-1, SP-2, SP-3 and SP-4 were 292.836 Å3, 476.803 Å3, 482.443 Å3, 551.018 Å3 and 621.467 Å3, and that of the corresponding MC isomers was 291.028 Å3, 487.861 Å3, 505.691 Å3, 579.697 Å3 and 649.539 Å3, respectively. The results also indicate that by introducing flexible alkyl chains, the free volume of SP-1 to SP-4 increased and were much larger than that of SP-OH. The larger free volume was favorable to reduce the π–π interactions between molecules and enhance the photosensitivity of the compounds. It could also be found that the difference in molecular free volume between SP-1 and SP-2 was not significant, but the photosensitivity of SP-2 was better, which further indicated that the flexible alkyl chains were more favorable improving the photosensitivity of SP compounds.

The electrostatic potential energy (EP) map can visually reflect the molecular size and positive–negative electrostatic potential energy regions, which is important for analyzing the intra- and intermolecular interaction forces of the compounds. The EP diagrams of the synthesized compounds were calculated and simulated using the DFT method (Fig. 4). The analysis of the potential distribution of the five compounds revealed that the negative potential regions were mainly located in the indole and nitro parts of the compounds, the positive potential regions were mainly located below the benzopyran, and the neutral regions were mainly located in the Csp-O ring plane and the alkyl chains. The potential of the Csp-O ring region in SP-OH was close to neutral (green), indicating its relatively good stability, while the Csp-O ring regions in SP-1 to SP-4 exhibited positive potential. The potential distribution range and density become larger with the increase in the free volume, indicating that the potential energy increased, which was conducive to the fracture of Csp-o bond in the molecule [32]. It is worth noting that the positive and negative potentials were uniformly distributed on the MC isomers, and the polarity of the compounds increased. The hydroxyl group in MC-OH had strongly positive charge, which effectively stabilized the N+ ion on MC isomer. At the same time, the electrostatic repulsion between the two groups increased, thus making ring-closed difficult. The N+ charge distribution in MC-1 was more concentrated (the blue region being darker and less extensive), while the introduction of the ester group reduced not only the N+ stability but also its electrostatic attraction to the phenoxy anion [33, 34]. On the contrary, the N+ charge distribution in MC-2 to MC-4 was relative dispersed, and the electrostatic gravitational force with the ester group was smaller. So it was easier to attract with the phenoxy anions, and thus easier to transform into SP, which were consistent with the experimental results.

Fig. 4
figure 4

Electrostatic potential energy maps of closed SP and open MC isomers. (Red–orange color means the most negative, green means electrically neutral, and blue color means the most positive)

3.2 Preparation of the Photochromic Fabrics Using the Synthesized Compounds

The synthesized five compounds as dyes were applied to dye PET fabrics to obtain functional changeable color textile. The dyeing process is shown in Fig. 5a. The dyeing exhaustions and color yields (K/S) of the five compounds on PET fabrics were measured and shown in Fig. 5 b, and c. Figure 5b demonstrated the effect of dyeing time on the exhaustion rate at the dye concentration of 2% (o.w.f). Among them, SP-1 had the fastest dyeing rate, while SP-OH, SP-2, SP-3 and SP-4 had no significant difference in the dyeing rate on PET fabrics. The exhaustions of SP-OH, SP-1, SP-2, SP-3 and SP-4 were 56.35%, 77.62%, 53.20%, 55.24% and 60.04%, respectively. The exhaustion of SP-1 was the highest, which was attributed to the introduction of the rigid benzene in the molecule enhancing the van der Waals force between the fiber and the molecule, and dye-fiber affinity was greatly improved. The hydroxyl group of SP-OH exhibited strong polarity making SP-OH more soluble in the dyeing process and reducing the affinity of the dye-fiber. With the extension of the alkyl chains in the molecule, the exhaustion of SP-2 to SP-4 increased successively, mainly due to the increased hydrophobicity of the molecule improved the affinity between the fiber and compounds. The K/S curves of the PET fabrics dyed with different compounds are shown in Fig. 5b. It can be seen that the dyed fabric samples had certain colors, probably due to the irreversible ring-opening reaction of a small number of compounds during the high-temperature and high-pressure dyeing process.

Fig. 5
figure 5

Dyeing properties of SP-OH, SP-1, SP-2, SP-3 and SP-4 on PET fabrics. a Schematic diagram of the preparation of photochromic PET fabrics; b Effect of dyeing time on exhaustion of PET Fabrics; c K/S values of PET fabrics dyed with different compounds

The photochromic performances of the PET fabrics dyed with different compounds were evaluated using apparent color yields (K/S). The K/S values of different samples were measured using Datacolor 650 at various UV irradiation time (Fig. 6). Figure 6a reflected the photoresponse performance of the SP-OH dyed PET fabric under UV light irradiation. After UV irradiation for 360 s, the K/S value at the maximum absorption wavelength (570 nm) in the visible region reached a maximum value of 0.8834, and the apparent color changed from light brown to brown. The photochromism was not obvious because the molecule lacked sufficient free volume for ring-opening, which greatly inhibited the conversion between SP and MC in the solid state. On the contrary, the PET fabrics dyed with SP-1 to SP-4 showed excellent photochromic properties with high contrast and high photo-response rate. They showed obvious color changes under the stimulation of UV light. The photochromic equilibrium time was 300 s, 120 s, 90 s and 75 s for SP-1 to SP-4, respectively, which were consistent with the photochromic performance of the compounds in solution and solid state. The K/S values at the maximum absorption wavelength were 4.8776 (580 nm), 1.514 (570 nm), 3.5446 (570 nm) and 3.1761 (570 nm) at the photostationary state (Fig. 6b–e). The color change of SP-1 dyed PET fabric was the most obvious (from light pink to dark purple) (Fig. 6b). The exhaustion rate of SP-1 was the highest, which meant the amount of SP-1 molecules on the PET fabric was the most. The benzene ring in the molecule had a certain positive effect on stabilizing the MC state. The K/S value of the SP-2 dyed PET fabric was relatively low, which could be attributed to the low exhaustion rate of SP-2 on PET fabric, but its apparent color change still had high contrast (from khaki to purple) (Fig. 6c). The PET fabrics dyed with SP-3 and SP-4 had similar photochromic properties. The apparent color both changed from pink to dark purple, but the photo-response speed of SP-4 was slightly faster (Fig. 6d, e). Figure 6f recorded the photochromic process of the dyed PET fabrics in detail using CIE 1931 chromaticity diagram. It can be clearly seen that the dyed fabrics were mainly located in the light pink region. After UV irradiation, the color of SP-1 to SP-4 dyed fabrics shifted to the blue-violet regions while the change of SP-OH dyed fabrics was not obvious. The above results further show that the SP-1 to SP-4 dyed fabrics had higher color contrast and stronger photosensitivity.

Fig. 6
figure 6

Photochromic properties of PET fabrics dyed with different compounds. ae Effect of UV irradiation time on K/S values of the PET fabrics dyed with SP-OH, SP-1, SP-2, SP-3 and SP-4, respectively; f The CIE chromaticity diagram of the dyed PET fabrics before and after UV irradiation

The reversibility of the dyed fabrics was also investigated. As shown in Fig. 7a, with the prolongation of visible light irradiation time, the K/S value of SP-OH dyed PET fabric at 570 nm gradually decreased to the initial state after 660 s. The color of the fabric also returned to the initial state, but the apparent color change contrast was low (Fig. 7f). The similar phenomenon was also observed for SP-1 to SP-4 dyed PET fabrics, they reached fading equilibrium at 960 s, 480 s, 450 s and 360 s, respectively (Fig. 8b–e). The fading rates of the SP-2 ~ SP-4 dyed PET fabrics were faster compared to the SP-1 dyed PET fabric. This is due to the fact that the compounds fixed to PET fibers existed in the form of aggregation, and the conversion from MC to SP in the solid state required overcoming the interaction between molecules, while the larger free volume could effectively reduce the π–π accumulation between molecules [35]. Whereas, the alkyl chains could also increase the flexibility of the internal structure of the compounds, so they showed higher photosensitivity.

Fig. 7
figure 7

Fading process of the photochromic PET fabrics dyed with different compounds under visible light stimulation. a SP-OH; b SP-1; c SP-2; d SP-3; e SP-4; f Photos of photochromic PET fabrics

Fig. 8
figure 8

Fatigue resistance of the PET fabrics dyed with five dyes after standard washing. a SP-OH; b SP-1; c SP-2; d SP-3; e SP-4

3.3 Color Fastness and Photochromic Fatigue Resistance of the Photochromic PET Fabrics

The rubbing fastness (dry and wet) and washing fastness of the dyed PET fabrics were measured and shown in Table 2. The PET fabrics dyed with SP-1 to SP-4 had good dry and wet rubbing fastness and washing fastness. The ester groups in the molecules improved the affinity between the dyes and PET fabrics. Long alkyl chains also increased the Van der Waals force between the compounds and fibers, endowing excellent color fastness to the dyed PET fabrics [36,37,38]. The wet rubbing fastness of the fabric dyed with SP-OH was not good, which was due to the weak affinity between SP-OH and polyester fiber. The hydroxyl groups in SP-OH enhanced the molecule’s hydrophilicity, and reduced the color fastness.

Table 2 Color fastness of the dyed PET fabrics (grade)

Fatigue resistance is important for the application of photochromic materials because it is closely related to the service life. The photochromic fatigue durability of the dyed PET fabrics after standard washing was further investigated (shown in Fig. 8a–e). The K/S decrease of the PET fabric dyed with SP-OH was the most obvious after every standard washing, which meant the poor fatigue resistance of SP-OH. Other four fabrics dyed with SP-1 to SP-4 have good wash fastness and excellent resistance to fatigue.

4 Conclusions

Five SP compounds with different free volume groups by introducing flexible spacers were designed and synthesized. The SP compounds with longer flexible chain groups exhibited excellent photosensitivity and better photochromic properties in both solution and solid state. The photosensitivity of the compounds was enhanced with the extension of the alkyl chains in the solid state. The excellent photo-switching between SP and MC isomers were triggered by the significant free volume generated by the long carbon chains. The flexible chains were more favorable for improving the photosensitivity of SP compounds. The smart color-changing textiles were obtained using designed dyes to dye PET fabric. The PET fabrics dyed with SP-1 to SP-4 showed excellent photochromic properties. Overall, the strategy of enhancing the photosensitivity of the photochromic compounds by increasing the flexibility-induced free volume provides an effective route to develop advanced photochromic bionic materials.