Is there a way to conditionally check if i’m on product variation page url like mydomain.com/myproduct?attribute_pa_color=red

Is there a way to conditionally check if i’m on product variation page url like mydomain.com/myproduct?attribute_pa_color=red