I have a vector (3D) valued function of two variables. I want to visualize it as a density plot, using R,G,B color values to display the value at the point (x,y). I've come up with a couple of attempts, neither satisfactory. One is to use a Raster, but that doesn't adapt to the function and so needs too many function evaluations. My other solution is to make three contour plots and combine them, but to do that I needed to use Opacity and then the range of colors is muted.
Here's an example, with a simple function:
f[x_, y_] := {x, y, x + y}
Table[
DensityPlot[f[x, y][[i]], {x, -1, 1}, {y, -1, 1},
ColorFunction -> (ReplacePart[RGBColor[0,0,0], i -> #] &)],
{i, 3}]
Show[Table[
DensityPlot[f[x, y][[i]], {x, -1, 1}, {y, -1, 1},
ColorFunction -> ({Opacity[1/3], ReplacePart[RGBColor[0,0,0], i -> #]} &)],
{i, 3}]]
The first table shows three DensityPlots with the RGB components I want, which look like this:
The Show combines them into one. But what I really want to do is add the color values in the three plots, and Show with Opacity averages them, giving a murky image. In this example, I want white in the upper right, black in the lower left.