To auto-select the default color on the pdp page and same, they can change the required color We need to pass the default color to set the option model; the sample code is added below.
pdp.on("afterShowContent", function () {
if (!self.model.get("custcol_jj_color")) {
var firstColor = _.find(self.model.get("options").models, (option)=> option.get("cartOptionId") === "custcol_jj_color")?.get('values')[1]?.internalid;
pdp.setOption("custcol_jj_color" ,firstColor)
}
})