Um, trivially, yes. (Ok, maybe not trivial. But not difficult.) The biggest question is just to recognize what you want to call purple. Your choice might play around with the red versus blue contribution in p.
First is to understand what color is white? White is the color [1,1,1] (scaled 0 to 1.)
Next, what is purple? I suppose there are different things you might call purple. A quick check with this page:
suggests you might want what they called an indigo variation of purple, assuming you want a match to the purple colormap shown in your picture. Something like [75 0 130]/255 seems about right. But there are certainly other variations of what one might call purple.
So how do we make a color map? Simple.
Your colormap is now purples. I am green with envy. But that would be a horse of another color. ;-)
Oh. One other point of interest (in this case, a real one in my eyes) is that IF you intend to print such an image, then it is good to know that IF the colors in your image will be out of gamut for the printer you will be using, then many color printers tend to turn bright blues a bit purplish and so purples might also move around a bit. This because of gamut mapping issues and interactions with how those colors are represented and how the printer drivers will move those colors around in color spaces. Purple is an interesting color in this context. But that really is a horse of a completely different color, and probably way off topic.