Introduction

Garments that have automatic or inherent perception or detection capabilities for changes in their environments are known as smart textiles (Kunigunde et al. 2010). Besides of stimuli-responsivity, they can also offer antimicrobial, flame-retardant, thermo-regulated, conductive, electromagnetic shielding properties and so on. As their physical or chemical properties will change correspondingly under the stimulation of environmental factors (light, temperature, pressure, pH and electric field, etc.) (Billah et al. 2008; Cheng et al. 2008a; Crespy and Rossi 2007; Fan et al. 2015; Hansen et al. 2016; Hu et al. 2012; Jochum and Theato 2013; Khattab et al. 2018a, 2019; Lee et al. 2015; Rosace et al. 2017), they have gained great attention for their intelligent functions. One of typical stimulus-responsive textiles is photochromic textile (Ayazi-Yazdi et al. 2017; Cheng et al. 2007; Chowdhury et al. 2014; Pinto et al. 2016b), they can protect consumers from the harmful effects of UV radiation by their reversible UV-induced color changes characteristics. At present, photochromic textiles are widely used in sensing environmental changes, brand protection, anti-ultraviolet radiation, sports fashion clothing and military camouflage (Arkhipova et al. 2017; Cheng et al. 2008a; Khattab et al. 2018b).

Spiropyran (SP) is one of the earliest and most widely used organic photochromic compounds in photochromic materials because they are easy to synthesize and exhibit fast fading time and good fatigue resistance (Kortekaas and Browne 2019). Typically, SP will convert to a planar merocyanine (MC) structure and change color when exposed to a certain wavelength of light and return to their original color when exposed to another wavelength of light or heat (Julia-Lopez et al. 2019; Pardo et al. 2011). At present, methods for preparing photochromic textiles using industrial photochromic dyes containing SP, including traditional dyeing and printing techniques (Aldib and Christie 2011; Cheng et al. 2008b; Khattab et al. 2018b; Parhizkar et al. 2014; Pinto et al. 2016a; Son et al. 2007), have been reported. However, the dyeing of photochromic organic dyes for textiles has encountered many problems such as easy degradation of dyes, low absorptivity of dyes, limited interaction between dyes and fiber matrix, and poor washability and light fastness (Fan and Wu 2017; Fan et al. 2015; Haitao et al. 2013; Pardo et al. 2009; Peng et al. 2015; Son et al. 2007; Sun et al. 2013). These shortcomings can be overcome by using microencapsulation technology, but there are also other disadvantages (Khattab et al. 2018b; Tsuru et al. 2019). Secondly, most of these as-prepared photochromic textiles are tunable between single-stimulus response color change system and barely have a multiple-stimulus response color-switching system (Mao et al. 2018). Moreover, many photochromic textiles have not been thoroughly studied, especially those have good durability and have multiple-stimulus response color changes (Fan et al. 2015; Feczko et al. 2012; Partington and Towns 2014). Therefore, seeking a new chemical method to prepare photochromic textiles with excellent photochromic properties and durability is the research goal of this paper.

Herein, we propose to employ click chemistry to construct covalent bonds between textiles and photochromic dye to solve this problem. In recent years, click chemistry has been widely used in functional materials, surface modification and many other fields due to its high product yield, mild conditions, and simple separation and purification operations (Wang et al. 2019; Ghosh et al. 2011; Hu et al. 2016; Moses and Moorhouse 2007; Palacin et al. 2009; Xu et al. 2017). All these prove that click chemistry reaction can be introduced in functional modification of textiles. As far as we know, there have been few reports on the use of click chemistry to prepare photochromic textiles. Thus, we tried to develop a new photochromic textile based on it. Among textile materials, cotton fabrics stand out for their softness, breathability, moisture absorption, comfortable wearing and low cost (Ghosh et al. 2018; Zhang et al. 2018), and are selected as substrates for the preparation of photochromic textiles. In addition, the introduction of click chemistry reaction between photochromic dye and cotton fabric will effectively improve its durability in practical daily use, and the real significance of functional photochromic textiles will be realized. To our knowledge, photochromic cotton fabrics prepared by thiol-ene click reaction have rarely been reported. It is believed that this study will open up a new horizon for the development of more effective and stable intelligent photochromic textiles.

In this paper, we proposed a novel method for preparing cotton fabrics with excellent photochromic properties, durability and tri-stimulus response color-changing. The schematic diagram of preparation route was shown in Fig. 1. Firstly, a novel photochromic compound with alkenyl end groups was synthesized, and then the cotton fabric was modified with MPTES to produce reactive thiol groups. Finally, the synthesized photochromic compound was grafted onto the cotton fabric based on thiol-ene click chemistry to form a covalent bond. The as-prepared materials were characterized by Fourier transform infrared spectroscopy (FTIR), Raman spectroscopy (Raman), ultraviolet visible near infrared spectroscopy (UV/vis), nuclear magnetic resonance spectroscopy (NMR), scanning electron microscopy (SEM) and energy dispersive spectroscopy (EDS). In addition, the fatigue resistance, fading time, washing fastness and ultraviolet resistance were studied in detail, and the photochromic mechanism was discussed in combination with density functional theory.

Fig. 1
figure 1

Schematic diagram of the preparation process of photochromic cotton fabric and its photochromic mechanism

Experimental

Materials

In this test, the cotton fabric (280 g/m2) was purchased from Saintyear Holding Group Co., Ltd, China. MPTES and 5,5′-dithio-bis-[2-nitrobenzoic acid] (DTNB) were provided from Adamas Reagent. Phenylhydrazine (AR), 2,2-dimethoxy-2-phenylacetophenone (AR), piperidine (AR) and 3-methyl-2-butanone (AR) were purchased from Sinopharm Chemical Reagent Co., Ltd. Allyl bromide (AR) and 5-nitrosalicylaldehyde (97%) were purchased from Aladdin. All chemicals were of analytical grade, and can be used without further purification.

Preparation of target photochromic compound monomer

The synthesis process of target photochromic compound monomer was shown in Fig. 2a.

Fig. 2
figure 2

a Synthesis process of target photochromic compound monomer. b Preparation process of MPTES pretreated cotton fabric and c Preparation process of photochromic cotton fabric

Synthesis of 2,3,3-trimethyl-3H indole

Phenylhydrazine (6.05 g, 0.055 mol) and absolute ethanol (25 ml) were added into 250 ml three-necked, and 3-methyl-2-butanone (4.675 g, 0.05 mol) was added drop by drop after stirring. 3 ml concentrated sulfuric acid was slowly added and the reaction was carried out in an oil bath at 80 °C for 4 h, during which the solution changed from light yellow to orange. After completion of the reaction, the reaction liquid was cooled to room temperature, and a large amount of ethanol was distilled off, and the pH was adjusted to 7 with a saturated sodium carbonate (Na2CO3) solution. After that, it was extracted three times with anhydrous ether and combined with oil phase, and then dried with anhydrous sodium sulfate (Na2SO4). Finally, the reaction product was placed overnight and distilled under reduced pressure to obtain a yellowish oily liquid of 5.94 g with a yield of about 90% (Zheng et al. 2018).

Synthesis of 1-allyl-2,3,3-trimethyl-indoline

2,3,3-trimethyl-3H indole (2.8 g, 0.0175 mol) and 3-bromopropylene (2.6 g, 0.025 mol) were added to a 250 ml three-necked flask, and reacted at 70 °C for 10 h, and cooled to room temperature to obtain brown–red viscous liquid. Thereafter, a certain amount of distilled water was added, and the pH of the solution was adjusted to 9–10 with 5% wt sodium hydroxide (NaOH) solution, and extracted with anhydrous diethyl ether three times, and then dried with anhydrous sodium sulfate (Na2SO4) and NaOH. Finally, the product was placed overnight, and a large amount of ether was evaporated by spin to obtain a pale red liquid of 2.95 g with a yield of about 84.3% (Zheng et al. 2018).

Synthesis of 1-allyl-6-nitro[2H]-1-benzopyran-2,2′-indoline

1-allyl-2,3,3-trimethyl-indoline (2.9 g, 0.0145 mol) and 5-nitrosalicylaldehyde (2.425 g, 0.0145 mol) were added to a 250 ml flask, 20 ml absolute ethanol was then added and 5 drops of piperidine were added slowly. Thereafter, the mixture was refluxed at 80 °C for 3 h in a nitrogen atmosphere, and the reaction liquid was cooled and condensed after the reaction was completed. Finally, the reaction product was placed overnight, and the precipitated solid was recrystallized from ethanol to get 2.45 g of a yellow solid with a yield of about 48.5% (McCoy et al. 2007).

Preparation of MPTES pretreated cotton fabric

A piece of cotton fabric of 5 × 5 cm2 was selected for this experiment. It should be noted that the weight of cotton fabric is 0.6115 g, the thickness is 0.429 mm, and the density of warp and weft is 108 × 56. The cotton fabric was immersed in a detergent solution containing 15 g/L NaOH and 7 g/L Peregal O (polyoxyethylene lauryl ether) and ultrasonic cleaned at 70 °C for 20 min to remove grease and impurities from cotton fabric substrates, which provided a favorable basis for subsequent process (Sun et al. 2017). The modification process of cotton fabric by MPTES was carried out according to our previous report. In short, 5% wt MPTES was dissolved in an ethanol-deionized aqueous solution (v/v = 4:1) at room temperature and stirred for 30 min. Then the as-washed cotton fabric was immersed into the above solution for 3 min and cured in vacuum at 110 °C for 3 min (Zhao et al. 2018). And the modification process of MPTES pretreated cotton fabric was shown in Fig. 2b.

Preparation of photochromic cotton fabric

The final synthesized SP photochromic compound was dissolved in 2-butanone at a bath ratio of 1:50, and 2,2-dimethoxy-2-phenylacetophenone with 0.5% wt was added as a photo-initiator. The MPTES modified cotton fabric was then dipped into the mixture solution and irradiated under UV light for 1 h. After completion of the reaction, the surface of the fabric was cleaned with a standard detergent and deionized water, and dried under vacuum at 50 °C to obtain the final product. And the preparation process of photochromic cotton fabric was shown in Fig. 2c.

Characterization

Material characterizations

The functional groups of the target photochromic compounds were investigated by FTIR spectra (Nicolet 6700, Thermo Fisher Scientific, America) and its chemical structure was studied by Roman imaging microscope (DXRxi, Thermo Fisher Scientific, America) with a 35 mW He–Ne laser source for 532 nm excitation. In addition, the molecular composition of the photochromic compound was analyzed by NMR spectroscopy (Bruker AM-600, Avance 600). The UV/vis absorption spectrum of the photochromic compound and the photochromic fabric was measured by an ultraviolet/visible near-infrared spectrophotometer (UV-3600 Plus, Shimadzu, Japan), and its wavelength was from 200 to 800 nm. The surface morphology of the as-obtained fabrics was observed by SEM (S-4800, America). And the element content and distribution of the as-obtained fabrics were observed by EDS-mapping (Quanta250, UK) using Hitachi S-4800. The color yield (K/S value) and CIE 1931 color space of the as-prepared cotton fabrics were performed by Datacolor 650 (Datacolor, America). The fabric transmittance and UV resistance were measured by the fabric UV transmittance tester (UV-1000F, America). Various images of the processability and flexibility were taken by using an optical camera. The tensile strength was measured according to Chinese standard GB/T 3923.1-1997, the bending length of fabrics were carried out according to the Chinese standard GB/T 18318-2001, and the crease recovery angle was tested according to the Chinese standard GB/T 3819-1997.

Evaluation of the fading rate and fatigue resistance

The fading rate and fatigue resistance of the photochromic cotton fabric were measured by colorimetry. The photochromic cotton fabric was irradiated with UV light for 10 s, and then fading to the original unexposed state by dark conditions, heating, and green light irradiation, respectively. The cycle of irradiation and fading was repeated 20 times. The maximum UV absorbance was measured after each cycle and then compared to the UV absorbance recorded in the original state.

Evaluation of the washing fastness

The washing fastness tests were performed according to AATCC 61-2007 standard. The as-prepared photochromic cotton fabrics were washed in a 0.37% detergent with 10 steel balls at 40 °C for 45 min and then rinsed twice in deionized water and finally dried at 60 °C.

Evaluation of UV resistance

The effect of UPF (UV Protection Factor) on the UV protection properties of photochromic cotton fabric was investigated. In this study, the fabric UV transmittance tester was used to evaluate the UPF of the photochromic cotton fabric according to the AATCC 183-2010 standard.

Results and discussion

Preparation of target photochromic compound monomer

In order to determine the synthesis of the target photochromic compound monomer, FTIR spectra were performed and the results were shown in Fig. 3a. It can be observed from the figure that the absorption peak at 3065 cm−1 is a characteristic absorption peak of the pyran ring. The peak at 2969 cm−1 is attributed to the stretching vibration of –CH3, while those at 2920 cm−1 and 2870 cm−1 are attributed to the stretching vibration of –CH2. The peak at 1650 cm−1 is attributed to the stretching vibration of the Cspiro = C bond, while those at 1609 cm−1 and 1508 cm−1 are attributed to the characteristic stretching vibration of –NO2 connected to the pyran ring. Four peaks appearing at 1479 cm−1, 1332 cm−1, 1271 cm−1 and 1027 cm−1 are assigned to the stretching vibration of Cspiro–O–C = (Fan et al. 2018; Zheng et al. 2018). The peak at 914 cm−1 belongs to the deformation vibration of C=CH2, and the peak at 746 cm−1 is attributed to the bending vibration of C–H in the pyran ring. All of these absorption peaks confirmed the existence of a SP structure in the product.

Fig. 3
figure 3

a FTIR spectra of the target photochromic compound SP. b UV spectra of the target photochromic compound SP (SP and MC refer to the SP and MC forms, respectively.). c1H-NMR spectra of the target photochromic compound SP and d13C-NMR spectra of the target photochromic compound SP

Furthermore, the 1H-NMR and 13C-NMR spectra of the target monomer SP are shown in Fig. 3c, d. It should be noted that in this experiment, a specific amount of the synthesized SP moiety was dissolved in CD3CN, and the frequency of NMR was 600 MHz. It can be observed from Fig. 3c that the absorption peak at 1.19 ppm (s, 3H, H-17) and the absorption peak near 1.28 ppm (s, 3H, H-6) can be attributed to the geminal methyl groups (–CH3) on the indole fragment of SP. The absorption peak at 1.95 ppm is attributed to the absorption peak of H2O, while the absorption peak of about 2.23 ppm is attributable to the CD3CN solvent peak. The absorption peaks at 3.68 ppm (d, 1H, H-18) and 3.92 ppm (d, 1H, H-18) can be attributed to the methylene group (–CH2) attached to the N atom on the indole fragment, while those at 5.08 ppm (dd, 1H, H-20) and 5.17 ppm (dd, 1H, H-20) can be assigned to = CH2 of the side chain of the indole fragment. One of the two absorption peaks at 5.86–5.96 ppm (m, 2H, H-19, H-12) is attributed to –CH = and the other is attributed to hydrogen on the pyran ring. The characteristic absorption peaks at 6.58 (d, 1H, H-3), 6.73 (d, 1H, H-11), 6.84–6.88 (m, 2H, H-5, H-2), 7.06 (d, 1H, H-6), 7.16 (dd, 1H, H-13) and 8.02–8.08 (m, 2H, H-16 and H-14) respectively, indicating the presence of photochromic SP aromatic[38]. In addition, the same conclusion can be seen from Fig. 3d. Tetramethylsilane (TMS) is defined as the zero point of the chemical shift, and the characteristic absorption peak at 117.34 ppm is assigned to the CD3CN solvent peak. The absorption peaks at 18.93–25.28 ppm are attributed to the geminal methyl groups on the indole fragment of SP, while the absorption peaks at 45.45–52.50 ppm are assigned to the carbon atoms on the indole ring. And the absorption peaks appearing at 106.68–159.37 ppm are classified as the SP aromatic ring. Based on data analysis of FTIR, 1H-NMR and 13C-HMR, the results indicate that the desired target photochromic compound monomer has been successfully synthesized.

The UV spectrum of SP compound under UV radiation is shown in Fig. 3b. Before the irradiation, the SP has almost no absorption in the visible light region, and the color appears to be colorless. When irradiated with UV light of 365 nm, it can be observed that the SP solution rapidly changed from colorless to dark purple (see Supporting information for details), and an absorption peak is formed centering on 579 nm in the visible region of the absorption spectrum. This is due to the molecular structure of SP is connected by spiro-carbon atom, and the benzopyran system and the indoline system are divided into two parts in an almost vertical state. The conjugate surface is small, and its absorption spectrum is in the UV region, which is called colorless form. Under the irradiation of UV light, the SP structure undergoes the breakage of the C–O bond, and the spiro-carbon atom changes from the SP3 hybrid state to the SP2 hybrid state, forming the trans-ring-opening intermediate MC, which forms an ionic form and develops color. Since the entire molecule is almost in a large conjugated system, the absorption spectrum shifts to the visible region (Gerkman et al. 2019; Kortekaas and Browne 2019).

Preparation of photochromic cotton fabric

To determine the interaction between MPTES, the target photochromic compound monomer and the cotton matrix, FTIR spectral analysis was performed and the results were shown in Fig. 4a. For the photochromic cotton fabric, the peaks appeared at 3332 cm−1, 2891 cm−1, 1713 cm−1, 1240 cm−1 and 1084 cm−1 were assigned to the stretching vibrations of O–H, C–H, C=O, and Cspiro–O–C=, respectively. The absorption peaks at 1026 cm−1 and 722 cm−1 were attributed to the stretching vibration of C–S–C, confirming that a click chemistry reaction occurred between the thiol groups and the ene groups in the modified cotton fabric molecule. Compared with the raw cotton fabric, it can be clearly observed that the cotton fabric modified by MPTES has no obvious S–H absorption peak at 2550 cm−1, which is similar to the related report (Rong et al. 2018). Therefore, a highly sensitive Raman spectroscopy test was performed on the modified cotton fabric, and the results were shown in Fig. 4b. An obvious characteristic absorption peak appeared at 2556 cm−1, which was attributed to S–H vibration. In addition, the successful grafting of thiol groups on cotton fabrics was also verified using the Elman reagent (DTNB). And the test results were presented in the inset of Fig. 4b. Apparently, the pretreated cotton fabric exhibited a bright yellow color after titration with the Elman reagent. This is due to the reaction of DTNB with thiols, which converted 2-nitro-5-thiobenzoate (NTB) into NTB2− with the change of yellow color (Yang et al. 2014). These results demonstrated that the cotton fabric was successfully functionalized by MPTES, and the synthesized target photochromic compound monomer was successfully grafted onto the cotton fabric.

Fig. 4
figure 4

a FTIR spectra of the tested samples. b Raman spectra of the raw cotton fabric and MPTES pretreated cotton fabric. Inset of b showed the chromogenic reaction after titration with DTNB (Ellman Reagent). c EDS-mapping spectra of the MPTES pretreated cotton fabric and d EDS-mapping spectra of the photochromic cotton fabric

In addition, EDS mapping was performed to further explore the distribution of fiber surface elements. From Fig. 4c, Si and S elements can be detected from the surface of the modified cotton fabric, indicating that MPTES has successfully functionalized the cotton fabric, as evidenced in Fig. 4b. Furthermore, due to the success of the pretreatment, it can be clearly observed from Fig. 4d that the photochromic cotton fabric also contains Si and S. And the N element was detected and evenly distributed on the surface of photochromic cotton fabric, which indirectly confirmed the success of thiol-ene click reaction.

To better visualize the morphological characteristics of the test samples, optical camera and SEM tests were carried out. Figure 5a, b and c showed photographs of the raw cotton fabric, MPTES modified cotton fabric and photochromic cotton fabric, respectively. As shown in Fig. 5d, g, the raw cotton fibers were flattened and twisted in longitudinal direction, with smooth surface and typical textile characteristics. After functionalization treatment (Fig. 5e), it can be clearly observed that the surface of the modified cotton fabric becomes rough the surface of the fiber at a higher magnification (Fig. 5h). Furthermore, it can also be observed from Fig. 5f, i that a large amount of the polymer was attached to the surface of the cotton fiber, which was due to the grafting of the SP macromolecules onto modified cotton fabrics.

Fig. 5
figure 5

Photographs of a raw cotton fabric, b MPTES pretreated cotton fabric and c photochromic cotton fabric. SEM images of d raw cotton fabric, b MPTES pretreated cotton fabric and c photochromic cotton fabric. gi the corresponding high magnification images of the test fabrics

Color characteristics of photochromic cotton fabric

Photochromic cotton fabric exhibited a reversible color change in two different colors when it irradiated by UV light. For better evaluation of the color characteristics of different test samples, the color strength (K/S value) was performed with Datacolor 650. It should be noted that the photochromic cotton fabric was firstly irradiated with UV light for 10 s, and then the color characteristic value of the fabric was measured immediately after discoloration. The color change of the fabric was measured by CIE (International Commission on Illumination) Lab color space, which is a three-dimensional system with the coordinates L*(brightness), a* (red-green characteristics) and b* (yellow-blue features) (Zuo et al. 2018). And the results were reported in Table 1. It can be observed from the table that the K/S value of the fabric was gradually increased, and the K/S value of the photochromic cotton fabric reached the maximum value after irradiation. The same conclusion was also supported in Fig. 6a.

Table 1 Color properties of raw cotton fabric, pretreated cotton fabric and photochromic cotton fabric
Fig. 6
figure 6

a The K/S values of the different test samples in the visible region. b The color distribution of the different test samples in the (x, y) chromaticity diagram (standard CIE 1931). c The preparation method and mechanism of photochromic cotton fabric

In addition, the change in the L* value also explains from the side that the brightness of the fabric gradually decreases. In addition, the L* value decreased gradually, which further explains the decrease of fabric brightness from the side. From the perspective of color light, the a* value of the cotton fabric after photochromic finishing was significantly increased, indicating that the fabric was reddish after UV irradiation. At the same time, it was also observed that the b* value of the photochromic cotton fabric before UV irradiation was the highest, suggesting that the obtained photochromic cotton fabric was yellowish. However, the b* value of the photochromic cotton fabric after UV light irradiation was lower than that before irradiation, and the results demonstrated that the color of the cotton fabric was blue after UV irradiation. These above conclusions can also be reflected from the change of fabric color in the table. Detailed color change procedures for different test samples were recorded in the CIE 1931 chromaticity diagram, as displayed in Fig. 6b. It can be clearly seen from the figure that the as-prepared photochromic cotton fabric was yellow, while the photochromic cotton fabric became purple after UV irradiation.

Furthermore, the image of the photochromic cotton fabric before and after irradiation was captured with an optical camera, as shown in Fig. 6c. Photochromic cotton fabric can be observed to turn purple under UV light (λ = 365 nm) irradiation, with reduced lightness and deeper color. However, it can reversibly return to the original color when placed in a dark environment, heating or using green light (λ = 532 nm) irradiation. The reason for this phenomenon is that the molecular structure of SP changes from a ring-closed to a ring-opening under UV radiation, and its color changes. In the dark environment, heated or exposed to green light irradiation, the change occurs reversibly, from a ring-opening to a ring-closed, and the color returns to its original state (Klajn 2014).

Photochromic mechanism

Based on the above discussion, a possible photochromic mechanism is proposed in Fig. 7. The structural formula of the ring-closed isomer of SP is denoted as 1 in Fig. 7a. The molecule consists of a chromene and an indoline moiety bound together by a spiro carbon atom and oriented perpendicular to each other. At this point, there is no conjugate between the two adjacent ring planes, and the absorption spectra is the superposition of the absorption spectra of the two rings, so the ring-closed system is usually colorless or light-colored. Under the condition of UV light irradiation, the excited energy level transition in SP leads to the heterolysis of Cspiro–O single bond. The rotation of the bond makes the two rings in the same plane, so a large conjugate system is formed and cis-MC is generated (Referring to 3 and 4 in Fig. 7a), which resulted in the red-shifted of the absorption spectrum and colored (Bretel et al. 2019). Interestingly, when the colored fabric is placed in darkness, heated, or exposed to green light irradiation, the fabric quickly changes reversibly from a ring-opening system back to a ring-closed system and returns to its original color (Athanassiou et al. 2006; Wang and Li 2018). It should be mentioned that the ring opening reaction can be expressed as C–O bond cleavage (Fig. 7a, left) or 6p electrocyclic ring opening (Fig. 7a, right), resulting in zwitterionic (5) or quinoidal (6) resonance forms. The final MC product is a mixture of these resonance forms (7 in Fig. 7a). Due to its planar structure and p-conjugation of the extension between the indoline and chromene moieties, the MC exhibits a single delocalization shift into the visible region in most non-polar solvents (Buback et al. 2010; Fleming et al. 2018).

Fig. 7
figure 7

a The photochemical and thermal isomerization mechanism of SP. b The frontier molecular orbital and energy gap (eV) of SP-MC calculated using B3LYP/6-31G*

The influence of HOMO and LUMO on the molecular properties is very important. The frontier molecular orbitals of the as-prepared photochromic SP target monomers are theoretically studied by density functional theory (DFT) at the B3LYP/6-31G* level (Kinashi et al. 2017). Figure 7b shows the frontier molecular orbital of the calculated SP-MC, that is, the orbit and energy of HOMO and LUMO.

According to the frontier molecular orbital theory, the molecular orbital of SP can be composed of the interaction of an indole ring and a naphthopyran. It can be seen from the figure that the HOMO of SP is mainly distributed in the indole ring while the LUMO is mainly distributed in the naphthopyran moiety. In SP, no significant effect occurs due to the orbital distribution is in two different parts connected by a spiro-carbon atom. The transition of HOMO–LUMO mainly corresponds to the charge transfer transition from indole ring to naphthopyran. Based on the symmetry of the frontier orbit, the intensity of this transition is very low. However, it can be found that the energy gap is gradually decreased when irradiated by UV light, suggesting that the conjugation of the indole ring and the naphthopyran moiety after ring-opening is enhanced. The HOMO energy is increased, and the system is prone to lose electrons, that is, it is easy to generate holes. Since the LUMO energy is decreased, indicating that the system is easy to accept electrons, and the ability of electron injection improves, which makes the flow of electron cloud easier. In addition, it can also be observed that the energy gap of the ring-opening system is significantly reduced compared with that of the ring-closed system, which is mainly caused by the formation of a larger π-conjugated system in the molecular structure during the ring-opening process. This further theoretically demonstrated the above photochromic mechanism (Kinashi et al. 2012; Wang et al. 2018).

Fading rate and fatigue resistance of photochromic cotton fabric

Fatigue resistance is an important evaluation index for photochromic fabrics because it is an important characteristic related to the service life of materials. The fatigue resistance of photochromic fabrics was evaluated by the number of reversible discoloration cycles. Three pieces of as-prepared photochromic cotton fabrics were irradiated under UV light for 10 s, and then fading for a period of time under different conditions of heating, dark environment and green light irradiation, respectively, and gradually restored to the original state. It is worth noting that the photostability and fatigue resistance of the photochromic fabric were evaluated by recording the UV/visible absorbance of the fabric before and after each cycle. Figure 8a–c displayed the fatigue resistance of photochromic cotton fabrics under different treatment conditions. The test results showed that the absorbance of the fabric did not change significantly after 10 cycles. As the number of cycles increases, the absorbance of the fabric decreased slightly when the number of cycles reaches 20 times. This demonstrated that the photochromic cotton fabric has a good fatigue resistance, and it can be found that the fabric has similar fatigue resistance under three different treatment conditions.

Fig. 8
figure 8

ac The fatigue resistance of photochromic cotton fabrics under heating, dark conditions and green light irradiation, respectively. df The fading rate of photochromic cotton fabrics under heating, dark conditions and green light irradiation, respectively. gi The fading rate of photochromic cotton fabrics at different temperatures (70–90 °C)

In addition, fading rate is another important parameter to measure photochromic fabrics. The fabric was first irradiated with UV light for 10 s to be colored, and then returned to its original color by different conditions. Figure 8d–f showed the fading rate of photochromic cotton fabrics under heating, dark conditions and green light irradiation, respectively. From Fig. 8d, it can be observed that with the increase of heating temperature, the absorbance of the fabric gradually decreased; when the heating temperature reaches 90 °C, the absorbance of the fabric reaches the lowest, and then returns to the original state. It should be pointed out that this experiment was conducted at different heating temperatures for 1 min to fade it. At the same time, it can be found from Fig. 8e that the photochromic cotton fabric restored to its original state after 5 min under dark condition. However, when exposed to green light (as shown in Fig. 8f), the photochromic cotton fabric can quickly return to its original state within 50 s. In addition, we further studied the temperature variables and the results are shown in Fig. 8g–i. It can be clearly seen from the figure that the higher the heating temperature, the faster the fading rate of the fabric; when the heating temperature reaches 90 °C, the fabric can quickly fade in 5 s. Therefore, we can conclude that the prepared photochromic cotton fabric has a fast fading time, and the heating temperature and green light irradiation treatment can accelerate its fading.

Practical application performance of photochromic cotton fabric

Since the color fabric will partially fade during the washing process, it will directly affect the service life in practical applications, and washing fastness performance should be considered (Fan et al. 2018). The fatigue resistance and fading rate of the photochromic cotton fabric samples under different treatment conditions after a standard washing fastness test were measured by the same method as mentioned above, and the results are shown in Fig. 9a–f. Figure 9a–c exhibited the fatigue resistance of photochromic cotton fabrics under heating, dark conditions and green light irradiation after experiencing a standard washing fastness test, respectively. It can be seen from the figure that the sample still has excellent fatigue resistance after 20 cycles of standard washing, and its absorbance can be maintained above 0.6. Besides, the test results of the fading rate (as shown in Fig. 9d–f) also revealed that the photochromic cotton fabric can quickly return to its original state in a short time. This demonstrated that the photochromic cotton fabric has a good washing fastness, which is due to the click chemistry reaction between the synthesized SP molecule and the cotton fabric to form a covalent bond.

Fig. 9
figure 9

ac The fatigue resistance of photochromic cotton fabrics under heating, dark conditions and green light irradiation after experiencing a standard washing fastness test, respectively. df The fading rate of photochromic cotton fabrics under heating, dark conditions and green light irradiation after experiencing a standard washing fastness test, respectively. g The UV resistance performance of different test samples and h Comparisons of comprehensive properties between different photochromic materials

UV protection factor (UPF) and UVA transmittance can directly evaluate the UV resistance of photochromic cotton fabrics, and the measurement results are shown in Fig. 9g. According to the standard: only when the UPF value of the sample is greater than 40, and the transmittance of UVA is less than 5%, it can be called “anti-UV product”, which is an indicator to measure whether a material is an “anti-UV product” (Khattab et al. 2018b). It can be seen from the figure that the UPF value of the photochromic cotton fabric is as high as 1820.55, which is much larger than the other two samples. In addition, the fabric transmittance test in the inset also shows that the UVA transmittance of the photochromic cotton fabric is significantly lower than 5%. The reason for the UV protection of fabrics can be attributed to the electronic structure of photochromic dye, allowing for a strong and selective absorption to UV. The mechanical properties and flexibility of the fabric after chemical modification have a great impact on the practical application. For this purpose, the tensile strength, bending length and crease recovery angle of raw cotton fabric, pretreated cotton fabric and photochromic cotton fabric were tested. It can be seen from the Table S1 that the tensile strength, the bending length and the dry and wet crease recovery angle of the treated fabric are slightly increased. Generally, increased tensile strength values and crease recovery angles result in worse softness of the cotton fabric. Therefore, the chemical treatment gives the fabric excellent mechanical properties but the flexibility is slightly lowered. In addition, the overall practical application performance of our photochromic cotton fabric, as well as some photochromic textiles reported in recent years (including fatigue resistance, fading rate, durability, tri-stimulus response, flexibility, and UV resistance), was studied in consideration of actual requirements, as shown in Fig. 9h. The results indicated that the prepared photochromic cotton fabric has good practical application performance and can be widely used in civil textile fields or detection systems, as well as other commercial applications.

Conclusions

In this work, a method for preparing photochromic cotton fabrics based on thiol-ene click chemistry was developed. The introduction of SP imparted the fabric excellent fatigue resistance and fast fading rate. Furthermore, the as-obtained fabric exhibited excellent durability due to the formation of covalent bonding. The prepared photochromic cotton fabric possessed fast photochromic response (picosecond level) under UV irradiation, and can be quickly restored to its original state under three different stimulation conditions (heating, dark conditions, and green light irradiation). The absorbance still remained at a high level when it experienced 20 reversible cycles (the absorbance of the fabric decreased from around 0.8 to about 0.6). In addition, the prepared fabrics can maintain good photochromic properties after being tested for standard washing fastness. The results of UV resistance test (UPF up to 1820.55 and UVA transmittance below 5%) indicated that the fabric has strong selective absorption to UV. In sum, this work provides insights in preparing high tri-stimulus response photochromic fabrics of smart textiles.

Supplementary data

SP solution can quickly change from colorless to dark purple under UV light irradiation, and can also rapidly and reversibly return to its original state under three different stimulation conditions (heating, dark conditions, and green light irradiation). The UV absorption spectra video was shown in the supporting information. In addition, the color-changing video of the smart photochromic cotton fabric was also attached to the supporting information.