BackgroundAs one of the components of visual photopigments in photoreceptor cells, opsin exhibits different spectral peaks and plays crucial roles in visual function. Besides, it is discovered to evolve other functions despite color vision. However, research on its unconventional function is limited nowadays. With the increase in genome database numbers, various numbers and types of opsins have been identified in insects due to gene duplications or losses. TheNilaparvata lugens(Hemiptera) is a rice pest known for its long-distance migration capability. In this study, opsins were identified inN. lugensand characterized by genome and transcriptome analyses. Meanwhile, RNA interference (RNAi) was carried out to investigate the functions of opsins, and then the Illumina Novaseq 6000 platform-based transcriptome sequencing was performed to reveal gene expression patterns.ResultsFour opsins belonging to G protein-coupled receptors were identified in theN. lugensgenome, including onelong-sensitive opsin(Nllw) together with twoultraviolet-sensitive opsins(NlUV1/2) and an additional newopsinwith hypothesized UV peak sensitivity (NlUV3-like). A tandem array ofNlUV1/2on the chromosome suggested the presence of a gene duplication event, with similar exons distribution. Moreover, as revealed by spatiotemporal expression, the fouropsinswere highly expressed in eyes with age-different expression levels. Besides, RNAi targeting each of the four opsins did not significantly affect the survival ofN. lugensin phytotron, but the silencing ofNllwresulted in the melanization of body color. Further transcriptome analysis revealed that silencing ofNllwresulted in up-regulation of atyrosine hydroxylasegene (NlTH) and down-regulation of anarylalkylamine-N-acetyltransferasesgene (NlaaNAT) inN. lugens, demonstrating thatNllwis involved in body color plastic development via the tyrosine-mediated melanism pathway.ConclusionsThis study provides the first evidence in a Hemipteran insect that an opsin (Nllw) takes part in the regulation of cuticle melanization, confirming a cross-talk between the gene pathways underlying the visual system and the morphological differentiation in insects.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12864-023-09470-7.