[Developing my comments on Patrick - all this got a little out of control!]
This is a really interesting question, and one of the reasons for his interest is that there is no “right” answer. Color representation and data interpolation can be done in different ways. You need to adapt your approach to the problem domain accordingly. Since we have not been given much a priori information about this domain, we can only explore some of the possibilities.
The color case mixes the water a bit, so put it aside temporarily and think about interpolating simple scalars first.
Interpolation Tour
Let's say we have several such data points:

What we want to find is that the y value on this graph will be at points along the x axis other than those for which we know the values. That is, we are looking for a function
y = f(x)
that goes through these points.
Clearly, there are many different ways that we could choose to join the dots. We could simply link them to straight line segments. Or we may need a smooth curve, and this curve can be simple or arbitrarily complex:

It is easy to understand where the red lines come from - we just draw straight lines from one known point to the next. The green line also looks reasonable, although we add some assumptions about how the curve should behave. On the other hand, it will be difficult to justify the blue line only on the basis of data, but there may be circumstances when we have reasons to model the system using this form - as we will see later.
Also pay attention to the dashed lines running along the sides of each curve. They go beyond known points, called extrapolation , not interpolation. This is often more doubtful than interpolation. At least when you move from one famous point to another, you have some evidence that you are heading the right path. Whereas the farther you choose from known points, the more likely you are to deviate from the path. But still, this is a useful technique, and it may make sense.
OK, that's why the image is pretty and everything, but how do we create these lines?
We need to find f(x) that will give us the desired y . Depending on the circumstances, we can use many different functions, but the most common is the use of a polynomial function, that is:
f(x) = a0 + a1 * x + a2 * x * x + a3 * x * x * x + ....
Now, given N individual data points, you can always find the perfect curve using a polynomial of degree N-1 - a straight line for two points, a parabola for three, a cubic for four, etc. - but if the data is unusually good, the curve tends to accelerate as the degree increases. Therefore, if there is no good reason to believe that the behavior of the data is well modeled by higher polynomials, usually instead interpolate the data piecewise , setting a different segment of the curve between each consecutive pair of points.
As a rule, each segment is modeled as a polynomial of degree 1 or 3 . The first is just a straight line, and it is used because it is very simple and does not require any information other than the two data itself. The latter is a cubic spline and is used because it is the simplest polynomial that will give you a smooth transition along each point. However, the calculation is a little more complicated and requires two additional pieces of information for each segment (it’s exact that these pieces depend on the particular spline shape you are using).
Linear interpolation is simple enough to go on a single line of code. If our first data point is (x1, y1) , and our second is (x2, y2) , then the linearly interpolated y in any intermediate x is:
y = y1 + (x - x1) * (y2 - y1) / (x2 - x1)
(Variants of this appear in some other answers.)
Cubic splines get too involved here, but Google should show some decent links. In any case, they may be too crowded, since you only have three points.
Back to the question
With everything under our belts, let's look at the problem as described:

We have a line (shown in gray), the color of which is known only at three points, and we are asked to calculate what color will be at some other point. Since we do not know how color is distributed, we must make some assumptions.
One of the basic assumptions is that the color changes along the line will be continuous , at least in some approximation. Clearly, if the line really looked like this:

then all the previous things about interpolation will come out of the window. We would have no reason to determine what color of any part should be, and should simply give up and return home. Suppose this is not the case, and we need to interpolate something.
Known colors are indicated as RGB . In this view, each channel represents a separate scalar value, and we can consider it as completely independent of the others. Thus, one completely reasonable approach would be to make piecewise linear interpolation of each channel and then recombine the results.
Doing this gives us something like this:

This is as good as possible, but there are aspects of the result that we may not like. Firstly, the transition from red to green passes through a rather dark gray-brown color. Another is that the green peak at 0.3 is a bit sharp.
It is important to note that in the absence of a more complete specification, these are really just aesthetic problems. Our technique sounds perfectly cool, but it does not give quite the kind of results that we may need. These kinds of things depend on our particular problem area, and ultimately it all depends on the choice.
Since we have only three data points - and, as Hans Passant suggested, perhaps we could try to set a parabola to simulate the entire curve on each channel? It is true, we have no reason to think that this is a good model, but it does not bother to try:

The differences between this gradient and the latter are instructive. The squareness smoothed everything, but also changed dramatically. Remember that the green channel starts and ends at 0. The parabola is symmetrical, so its maximum should be in the middle. The only way it can fit in green growth to 0.3 is to keep growing to 0.5. (There is a similar effect in the red channel, but this is less obvious, because in this case it is underloading and the value is clamped to 0.)
Do we have evidence that such a shape is really present in our color line? Not. We explicitly introduced it with our model selection. This does not make it invalid - we can have good reasons for it to work this way - once again it is a matter of choice.
But what about HSV?
So far, we have adhered to the original RGB color space, but since various people rushed to point out this, it may be less ideal for interpolation: color and intensity are interconnected in RGB, so interpolating between two different color intensities usually captures you through which a gray intermediate level of intensity.
In the HSV view, color and intensity are in separate dimensions, so we do not get this problem. Why not convert and interpolate in this space?
This immediately gives rise to difficulty - or, in any case, another solution. The mapping between HSV and RGB is not bijective ; in particular, black , which is one of our three data points, is one point in the RGB space, but occupies an entire plane in HSV. We cannot interpolate between a point and a plane, so we need to select one specific black HSV point for the transition.
This is the basis of Patrick's ingenious solution, in which H and S are specially selected so that the entire color gradient is linear. The result looks something like this:

It looks a lot prettier and brighter than previous attempts, but there are a few things we may encounter.
One important problem is that in case V, where we still have certain data at all three points, this data is not actually linear, and therefore linear correspondence is only an approximation. This means that the value that we see here at 0.3 is not quite what it should be.
Another, in my opinion, bigger, picky: where are all the blue ones coming from? All three of our known RGB data points have B = 0. It seems a little strange to suddenly introduce a whole bunch of blue, for which we seem to have no evidence. Check out this graph of RGB components in the Patrick HSV interpolation:

The reason for the blue is, of course, that when switching color spaces, we specifically chose a model where, if you continue to go from green, you inevitably get to blue. At the same time, we had to abandon one of our points of these shades and decided to fill it with linear extrapolation from the other two, which means that we continue to move, from green to blue to the hills and far.
Once again, this is not unacceptable, and we may have a good reason for this. But, in my opinion, this is a little, but more than the previous piecewise linear example due to this extrapolation.
So is this the only way to do this in HSV? Of course not. There is always a choice.
For example, instead of selecting the H and S values in 1.0 to maximize linearity, how about we instead select them to minimize the piecewise linear interpolation? Since this happens, for S the two strategies coincide: at both points it is 100, so we also make 100 at the end. Two segments are collinear. For H, however, we just save it in the second segment. This gives the following result:

It's not as cute as the previous one, but to me it seems a little more believable. Once again, however, this is largely an aesthetic judgment. This does not make it the “right” answer, more than it does Patrick or any other “wrong”. As I said at the beginning, there is no “right” answer. All this is a matter of choosing in accordance with your needs for a particular problem - and the realization that you made this choice and how they affect your result.