Microsoft DirectX 8.0 (Visual Basic)

D3DXColorLerp

Uses linear interpolation to create a color value.

D3DXColorLerp( _ 
    COut As D3DCOLORVALUE, _ 
    C1 As D3DCOLORVALUE, _ 
    C2 As D3DCOLORVALUE, _ 
    s As Single)

Parameters

COut
A D3DCOLORVALUE type that is the result of the operation, the result of the linear interpolation.
C1
A source D3DCOLORVALUE type.
C2
A source D3DCOLORVALUE type.
s
Parameter that linearly interpolates between the colors, C1 and C2, treating them both as 4-D vectors. There are no limits on the value of s.

Error Codes

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.

Remarks

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.

See Also

D3DXColorModulate, D3DXColorNegative, D3DXColorScale