Scatterplot: Colour distribution vector

The aim is to create a vector that has the colour distribution KG=0 -> grey; EG=1-> dark green) to match the groups. Unfortunately, my colour vector does not have the same length and distribution as the variable group.

colors = c("grey","darkgreen")
colors2 <- colors[as.numeric(df_2a_red_long_cleanpair$Gruppe)]

thank you

I would do it like this

(df_2a_red_long_cleanpair <- data.frame(Gruppe=c(rep("EG=1",5),
                                                rep("KG=0",3))))

colors <- c("KG=0"="grey",
            "EG=1"="darkgreen")
(colors2 <- colors[df_2a_red_long_cleanpair$Gruppe])