Btw: the following is a better version of my num2col function (still assuming that the numeric values are integers in the range {0,1,2,…}):
function num2col(i;vcol = [colorant"red",colorant"green",colorant"blue"])
return vcol[min(i+1,length(vcol))]
end
Then you find:
m = rand(0:3,2,4)
num2col.(m)
gives, say:
while specifying some colors like:
MYCOL = distinguisable_colors(4,colorant"red")
#
num2col.(m;vcol=MYCOL)
leads to
Here, function distinguishable_colors() gives maximally distinguishable colors where the first argument gives the number of colors, and the optionally second argument gives a “seed” for picking the colors. (The seed can be a “scalar” color, or a vector of colors, I think.)

