Microsoft DirectX 8.1 (Visual Basic) |
Uses linear interpolation to create a color value.
D3DXColorLerp( _ COut As D3DCOLORVALUE, _ C1 As D3DCOLORVALUE, _ C2 As D3DCOLORVALUE, _ s As Single)
If the function fails, an error is raised and Err.Number can be set to one of the following values.
D3DERR_INVALIDCALL |
D3DERR_OUTOFVIDEOMEMORY |
For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.
This function interpolates the red, green, blue, and alpha components of a D3DCOLORVALUE type between two colors, as shown in the following example.
COut.r = .C1.r + s * (C2.r - C1.r)
If you are linearly interpolating between the colors A and B, and s is 0, the resulting color is A. If s is 1, the resulting color is B.