Custom Color Map for Vector Data?


Apologies if this question has been asked/answered already.

I currently have a VTK mesh model upon which I’ve placed vector/arrow glyphs. I know I can apply a color map based on the magnitude of each vector, but is there a way I can either edit or create a color map such that the RGB color codes correspond to the values of all three of its components? For example, a vector that lies completely in the x-direction would have a RGB code of [1, 0, 0] and be colored as pure red, but another vector that lies in both the x and z-directions would have an RGB code of [1, 0, 1] and thus be colored purple.

I’m aware that a color map can be applied to a single component at a time and each component can be visualized individually as their own colored glyphs, but I’m looking for a way to visualize the resolved vectors in such a way that the color map takes all three components (x, y, z) into account to determine the color value.

Appreciate any and all help!