How do I interpolate colors
Another way of doing the same maths is
Out = C0 + (C1-C0) * t
Where t = 0 to 1
And as SiCrane said , you have to treat the R,G,B parts separately.
Out = C0 + (C1-C0) * t
Where t = 0 to 1
And as SiCrane said , you have to treat the R,G,B parts separately.
Linear interpolation of each RGB component is the most straightforward, and the results are often acceptable.
If you need a 'better' interpolation, you can convert the RGB colour to HSV, interpolate the HSV, and convert back to RGB for display.
If you need a 'better' interpolation, you can convert the RGB colour to HSV, interpolate the HSV, and convert back to RGB for display.
really? just interpolating the rgb elements separately will do it? I thought there was more to it.
If the colors are similar, then just interpolating the components is
probably acceptable. If the colors are very different, it's a different
story. There is no "right" way to interpolate from red to blue, you have
to decide what sort of intermediate colors you want.
probably acceptable. If the colors are very different, it's a different
story. There is no "right" way to interpolate from red to blue, you have
to decide what sort of intermediate colors you want.
Quote:Original post by ddyerIf you are approaching colour from an artists perspective, HSV interpolation works pretty well.
If the colors are similar, then just interpolating the components is
probably acceptable. If the colors are very different, it's a different
story. There is no "right" way to interpolate from red to blue, you have
to decide what sort of intermediate colors you want.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement