Plot colour based on conditional

Is it possible to set a plot colour based on a conditional statement?

In the plot method I use, for example, color = [:gray :gray :gray] to give me gray-coloured plot for three plots which appear in a side-by-side configuration.

So I would like to be able to have this plot colour change based on an if-else statement but I can’t seem to get that to work in Julia.

colorcond(x) = x<0 ? :red : :green
x = randn(50)
plot(x; color=colorcond.(x))

Doesn’t quite work as intended for my purpose but this nonetheless does provide a bit of an answer. Thank you.