That's an awful lot of colors to distinguish, but here's one quick way. I'm not exactly sure how you want to assign the colors, so the example below is artificial:
library(ggplot2)
pal = c(hcl(0,100, seq(20,100, length.out=25)), hcl(240,100, seq(100,20, length.out=25)))
dat = data.frame(x=1:50, y=1, color=pal)
ggplot(dat, aes(x, y, colour=pal)) +
geom_point(size=5) +
scale_colour_identity()
Maybe the example below is closer to your use case. Here we use colorRampPalette to generate the diverging palette by interpolating between the colors we want to use:
set.seed(2)
dat = data.frame(x=1:100, y=cumsum(rnorm(100)))
# Create a palette-generating function
pal = colorRampPalette(c(hcl(0,100, c(20,100)), hcl(240,100,c(100,20))))
ggplot(dat, aes(x, y, colour=y)) +
geom_line() +
geom_point(size=5) +
scale_colour_gradientn(colors=pal(50))